aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/core/report.py
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2019-01-25 14:44:20 +0000
committerMyron Sosyak <myronx.sosyak@intel.com>2019-04-03 10:38:37 +0100
commit34276b464ac7a2013d292680e545d25e515bb0cd (patch)
treef7078cb7c153b2de9fc27c054c60fb5cb124317c /yardstick/benchmark/core/report.py
parent6a0ab66ed2890c7236db8ff49cde909f24f5d92a (diff)
Use baro and yardstick metrics in dynamic HTML report
_combine_metrics combines metrics from different sources. This is for use with the ``yardstick report generate-nsb`` command, which will combine yardstick and barometer metrics in the dynamic HTML report. JIRA: YARDSTICK-1593 Change-Id: I87002948ebb4cc88fb0932380bcb9920eb53db58 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Diffstat (limited to 'yardstick/benchmark/core/report.py')
-rw-r--r--yardstick/benchmark/core/report.py30
1 files changed, 24 insertions, 6 deletions
diff --git a/yardstick/benchmark/core/report.py b/yardstick/benchmark/core/report.py
index 587c85a14..e5dc62050 100644
--- a/yardstick/benchmark/core/report.py
+++ b/yardstick/benchmark/core/report.py
@@ -342,25 +342,43 @@ class Report(object):
"""Start NSB report generation."""
_, report_data = self._generate_common(args)
report_time = report_data.pop('Timestamp')
- report_keys = sorted(report_data, key=str.lower)
- report_tree = JSTree().format_for_jstree(report_keys)
report_meta = {
"testcase": self.yaml_name,
"task_id": self.task_id,
}
+ yardstick_data = {}
+ for i, t in enumerate(report_time):
+ for m in report_data:
+ if not yardstick_data.get(m):
+ yardstick_data[m] = {}
+ yardstick_data[m][t] = report_data[m][i]
+
+ baro_data = self._get_baro_metrics()
+ baro_timestamps = baro_data.pop('Timestamp')
+
+ yard_timestamps = report_time
+ report_time = self._combine_times(yard_timestamps, baro_timestamps)
+
+ combo_metrics, combo_keys, combo_table = self._combine_metrics(
+ baro_data, baro_timestamps, yardstick_data, yard_timestamps)
+ combo_time = self._combine_times(baro_timestamps, yard_timestamps)
+ combo_tree = JSTree().format_for_jstree(combo_keys)
+
template_dir = consts.YARDSTICK_ROOT_PATH + "yardstick/common"
template_environment = jinja2.Environment(
autoescape=False,
loader=jinja2.FileSystemLoader(template_dir),
lstrip_blocks=True)
+ combo_data = combo_metrics
context = {
"report_meta": report_meta,
- "report_data": report_data,
- "report_time": report_time,
- "report_keys": report_keys,
- "report_tree": report_tree,
+ "report_data": combo_data,
+ "report_time": combo_time,
+ "report_keys": combo_keys,
+ "report_tree": combo_tree,
+ "table_data": combo_table,
}
template_html = template_environment.get_template("nsb_report.html.j2")