Enhance debug logging in allocation candidate handling

There is reasonably good debug logging when filtering results to
create a set of allocation candidates, but the latter half of the
processing which merges candidates, removes nested providers and
limits results is not well logged.

This change adds some debug logs in that handling to provide more
information. While the logs do report the sizes of the entities
involved another important factor of the logging is the timestamps
that indicate time spent between each message.

Change-Id: I98ce4cade9acd64285c5a65bd439e37cb6a308f3
Story: 2005647
Task: 30927
This commit is contained in:
Chris Dent 2019-05-16 11:21:32 +01:00
parent 1281806c99
commit 73b29cd6e4
1 changed files with 8 additions and 0 deletions

View File

@ -252,6 +252,9 @@ class AllocationCandidates(object):
continue
kept_summary_objs.append(summary)
summary_objs = kept_summary_objs
LOG.debug('Limiting results yields %d allocation requests and '
'%d provider summaries', len(alloc_request_objs),
len(summary_objs))
elif context.config.placement.randomize_allocation_candidates:
random.shuffle(alloc_request_objs)
@ -937,6 +940,8 @@ def _merge_candidates(candidates, group_policy=None):
psums = [psum for psum in all_psums if
psum.resource_provider.root_provider_uuid in tree_uuids]
LOG.debug('Merging candidates yields %d allocation requests and %d '
'provider summaries', len(areqs), len(psums))
return list(areqs), psums
@ -1022,4 +1027,7 @@ def _exclude_nested_providers(allocation_requests, provider_summaries):
if ps.resource_provider.uuid not in all_rp_uuids:
provider_summaries.remove(ps)
LOG.debug('Excluding nested providers yields %d allocation requests and '
'%d provider summaries', len(allocation_requests),
len(provider_summaries))
return allocation_requests, provider_summaries