From 73b29cd6e474882380b19c0fc0217cc47434de59 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Thu, 16 May 2019 11:21:32 +0100 Subject: [PATCH] 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 --- placement/objects/allocation_candidate.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/placement/objects/allocation_candidate.py b/placement/objects/allocation_candidate.py index 1fd9b38ec..857705ff2 100644 --- a/placement/objects/allocation_candidate.py +++ b/placement/objects/allocation_candidate.py @@ -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