From: Taseer Date: Tue, 4 Jul 2017 19:12:08 +0000 (+0500) Subject: Make same workloads distinguishable for report. X-Git-Tag: opnfv-5.0.0~69 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=5ad321a08cf289ca67a4a06580bb9803ca8e62e5;p=qtip.git Make same workloads distinguishable for report. Issue encountered in case of "memory" results. JIRA: QTIP-257 Change-Id: I27ca0220e2004a0cce54c5301afca284923e52ca Signed-off-by: Taseer Ahmed --- diff --git a/qtip/cli/commands/cmd_report.py b/qtip/cli/commands/cmd_report.py index 1a58aa60..cca1283c 100644 --- a/qtip/cli/commands/cmd_report.py +++ b/qtip/cli/commands/cmd_report.py @@ -14,13 +14,14 @@ from prettytable import PrettyTable from qtip.reporter.console import ConsoleReporter -def extract_section(sections, section_name, node): +def extract_section(qpi, section_name, node): """ Extract information related to QPI """ - qpi = query(sections).where(lambda child: child['name'] == node) \ - .select_many(lambda child: child['sections']) \ - .where(lambda child: child['name'] == section_name) \ - .first() - return qpi + data = query(qpi).where(lambda nodes: nodes['name'] == node) \ + .select_many(lambda section: section['sections']) \ + .where(lambda section: section['name'] == section_name) \ + .first() + + return data def display_report(report, section_name, node): @@ -32,7 +33,8 @@ def display_report(report, section_name, node): for metric in section_report['metrics']: for wl in metric['workloads']: - table_workload.add_row([wl['name'], + table_workload.add_row(['{}.{}'.format(metric['name'], + wl['name']), wl['description'], wl['result'], wl['score']])