From: Patrick Donnelly Date: Thu, 23 Jun 2022 15:37:14 +0000 (-0400) Subject: qa: allow check_counter to look at nested keys X-Git-Tag: v16.2.15~194^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8b9c6eb9f08725215f6bdd3dd8185d0aa44f998c;p=ceph.git qa: allow check_counter to look at nested keys Signed-off-by: Patrick Donnelly (cherry picked from commit d8ec1bd8e65542d2fb8ccf6103ce3b2768d1551b) --- diff --git a/qa/tasks/check_counter.py b/qa/tasks/check_counter.py index bab1f7e4273b..6219cb0d8e38 100644 --- a/qa/tasks/check_counter.py +++ b/qa/tasks/check_counter.py @@ -84,19 +84,20 @@ class CheckCounter(Task): name = counter minval = 1 expected.add(name) - subsys, counter_id = name.split(".") - if subsys not in perf_dump or counter_id not in perf_dump[subsys]: - log.warning("Counter '{0}' not found on daemon {1}.{2}".format( - name, daemon_type, daemon_id)) - continue - value = perf_dump[subsys][counter_id] - - log.info("Daemon {0}.{1} {2}={3}".format( - daemon_type, daemon_id, name, value - )) - if value >= minval: - seen.add(name) + val = perf_dump + for key in name.split('.'): + if key not in val: + log.warning(f"Counter '{name}' not found on daemon {daemon_type}.{daemon_id}") + val = None + break + + val = val[key] + + if val is not None: + log.info(f"Daemon {daemon_type}.{daemon_id} {name}={val}") + if val >= minval: + seen.add(name) if not dry_run: unseen = set(expected) - set(seen)