diff options
author | Patrice Buriez <patrice.buriez@intel.com> | 2018-11-30 12:16:43 +0100 |
---|---|---|
committer | Patrice Buriez <patrice.buriez@intel.com> | 2018-12-19 09:13:11 +0100 |
commit | 02dbbd651c64623eb4f6d808ede0b938ca8787ed (patch) | |
tree | 7b5873188b6ec4a79f4984fb10334557e97e5a8d /yardstick/benchmark/core | |
parent | b122686cb06e89420e9d8141df535f6c43de29ab (diff) |
Use Chart.js for graphs in HTML reports
This JavaScript library is available under MIT license.
Also adjusted version for jQuery and jsTree,
and added fallback font-family names.
JIRA: YARDSTICK-1367
Topic: report/html_table (6 of 12)
Change-Id: Ibe8b7e3d1f1365d2cbc019bfc22762aaa365a4e1
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
Diffstat (limited to 'yardstick/benchmark/core')
-rw-r--r-- | yardstick/benchmark/core/report.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/yardstick/benchmark/core/report.py b/yardstick/benchmark/core/report.py index a484a49f3..530fbf165 100644 --- a/yardstick/benchmark/core/report.py +++ b/yardstick/benchmark/core/report.py @@ -135,7 +135,7 @@ class Report(object): self.db_task = self._get_tasks() field_keys = [] - temp_series = [] + datasets = [] table_vals = {} field_keys = [encodeutils.to_utf8(field['fieldKey']) @@ -143,7 +143,6 @@ class Report(object): for key in field_keys: self.Timestamp = [] - series = {} values = [] for task in self.db_task: task_time = encodeutils.to_utf8(task['time']) @@ -155,16 +154,14 @@ class Report(object): task_time = head + "." + tail[:6] self.Timestamp.append(task_time) if task[key] is None: - values.append('') + values.append(None) elif isinstance(task[key], (int, float)) is True: values.append(task[key]) else: values.append(ast.literal_eval(task[key])) + datasets.append({'label': key, 'data': values}) table_vals['Timestamp'] = self.Timestamp table_vals[key] = values - series['name'] = key - series['data'] = values - temp_series.append(series) template_dir = consts.YARDSTICK_ROOT_PATH + "yardstick/common" template_environment = jinja2.Environment( @@ -173,7 +170,7 @@ class Report(object): trim_blocks=False) context = { - "series": temp_series, + "datasets": datasets, "Timestamps": self.Timestamp, "task_id": self.task_id, "table": table_vals, |