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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Tests for the Chromium Performance Dashboard data format implementation.""" 5 """Tests for the Chromium Performance Dashboard data format implementation."""
6 6
7 import imp 7 import imp
8 import os.path 8 import os.path
9 import sys 9 import sys
10 import unittest 10 import unittest
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 self.assertEquals(1, len(charts['chart1'])) 66 self.assertEquals(1, len(charts['chart1']))
67 self.assertEquals({ 67 self.assertEquals({
68 'type': 'scalar', 68 'type': 'scalar',
69 'units': 'ms', 69 'units': 'ms',
70 'value': 1}, charts['chart1']['val1']) 70 'value': 1}, charts['chart1']['val1'])
71 self.assertEquals(1, len(charts['chart2'])) 71 self.assertEquals(1, len(charts['chart2']))
72 self.assertEquals({ 72 self.assertEquals({
73 'type': 'scalar', 73 'type': 'scalar',
74 'units': 'ms', 74 'units': 'ms',
75 'value': 2}, charts['chart2']['val2']) 75 'value': 2}, charts['chart2']['val2'])
76
77 def test_vectors(self):
78 """Test recording a list of scalar values."""
79 recorder = ChartDataRecorder('benchmark')
80 recorder.record_vector('chart1', 'val1', 'ms', [1, 2])
81 recorder.record_vector('chart2', 'val2', 'ms', [])
82
83 result = recorder.get_chart_data()
84 self.assertEquals('1.0', result['format_version'])
85 self.assertEquals('benchmark', result['benchmark_name'])
86
87 charts = result['charts']
88 self.assertEquals(2, len(charts))
89 self.assertEquals(1, len(charts['chart1']))
90 self.assertEquals({
91 'type': 'list_of_scalar_values',
92 'units': 'ms',
93 'values': [1, 2]}, charts['chart1']['val1'])
94 self.assertEquals(1, len(charts['chart2']))
95 self.assertEquals({
96 'type': 'list_of_scalar_values',
97 'units': 'ms',
98 'values': []}, charts['chart2']['val2'])
OLDNEW
« 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