Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: mojo/devtools/common/devtoolslib/perf_dashboard_unittest.py

Issue 1433693004: mojo_benchmark: aggregate results over multiple runs. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address Ben's comments. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/devtools/common/devtoolslib/perf_dashboard.py ('k') | mojo/devtools/common/mojo_benchmark » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/devtoolslib/perf_dashboard_unittest.py
diff --git a/mojo/devtools/common/devtoolslib/perf_dashboard_unittest.py b/mojo/devtools/common/devtoolslib/perf_dashboard_unittest.py
index 98714c96fdf630d57e4c3af328c928435e825b1f..efa81054612ac66d7ca0f875c05af269a1c46ec9 100644
--- a/mojo/devtools/common/devtoolslib/perf_dashboard_unittest.py
+++ b/mojo/devtools/common/devtoolslib/perf_dashboard_unittest.py
@@ -73,3 +73,26 @@ class ChartDataRecorderTest(unittest.TestCase):
'type': 'scalar',
'units': 'ms',
'value': 2}, charts['chart2']['val2'])
+
+ def test_vectors(self):
+ """Test recording a list of scalar values."""
+ recorder = ChartDataRecorder('benchmark')
+ recorder.record_vector('chart1', 'val1', 'ms', [1, 2])
+ recorder.record_vector('chart2', 'val2', 'ms', [])
+
+ result = recorder.get_chart_data()
+ self.assertEquals('1.0', result['format_version'])
+ self.assertEquals('benchmark', result['benchmark_name'])
+
+ charts = result['charts']
+ self.assertEquals(2, len(charts))
+ self.assertEquals(1, len(charts['chart1']))
+ self.assertEquals({
+ 'type': 'list_of_scalar_values',
+ 'units': 'ms',
+ 'values': [1, 2]}, charts['chart1']['val1'])
+ self.assertEquals(1, len(charts['chart2']))
+ self.assertEquals({
+ 'type': 'list_of_scalar_values',
+ 'units': 'ms',
+ 'values': []}, charts['chart2']['val2'])
« no previous file with comments | « mojo/devtools/common/devtoolslib/perf_dashboard.py ('k') | mojo/devtools/common/mojo_benchmark » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698