| OLD | NEW |
| 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 # Disable the line-too-long warning. | 5 # Disable the line-too-long warning. |
| 6 # pylint: disable=C0301 | 6 # pylint: disable=C0301 |
| 7 """This module implements the Chromium Performance Dashboard JSON v1.0 data | 7 """This module implements the Chromium Performance Dashboard JSON v1.0 data |
| 8 format. | 8 format. |
| 9 | 9 |
| 10 See http://www.chromium.org/developers/speed-infra/performance-dashboard/sending
-data-to-the-performance-dashboard. | 10 See http://www.chromium.org/developers/speed-infra/performance-dashboard/sending
-data-to-the-performance-dashboard. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 def record_scalar(self, chart_name, value_name, units, value): | 34 def record_scalar(self, chart_name, value_name, units, value): |
| 35 """Records a single measurement value of a scalar type.""" | 35 """Records a single measurement value of a scalar type.""" |
| 36 if chart_name not in self.charts: | 36 if chart_name not in self.charts: |
| 37 self.charts[chart_name] = {} | 37 self.charts[chart_name] = {} |
| 38 self.charts[chart_name][value_name] = { | 38 self.charts[chart_name][value_name] = { |
| 39 'type': 'scalar', | 39 'type': 'scalar', |
| 40 'units': units, | 40 'units': units, |
| 41 'value': value} | 41 'value': value} |
| 42 | 42 |
| 43 def record_vector(self, chart_name, value_name, units, values): |
| 44 """Records a single measurement value of a list of scalars type.""" |
| 45 if chart_name not in self.charts: |
| 46 self.charts[chart_name] = {} |
| 47 self.charts[chart_name][value_name] = { |
| 48 'type': 'list_of_scalar_values', |
| 49 'units': units, |
| 50 'values': values} |
| 51 |
| 43 def get_chart_data(self): | 52 def get_chart_data(self): |
| 44 """Returns the JSON string representing the recorded chart data, wrapping | 53 """Returns the JSON string representing the recorded chart data, wrapping |
| 45 it with the required meta data.""" | 54 it with the required meta data.""" |
| 46 chart_data = { | 55 chart_data = { |
| 47 'format_version': '1.0', | 56 'format_version': '1.0', |
| 48 'benchmark_name': self.benchmark_name, | 57 'benchmark_name': self.benchmark_name, |
| 49 'charts': self.charts | 58 'charts': self.charts |
| 50 } | 59 } |
| 51 return chart_data | 60 return chart_data |
| 52 | 61 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 208 |
| 200 dashboard_params = urllib.urlencode({ | 209 dashboard_params = urllib.urlencode({ |
| 201 'masters': master_name, | 210 'masters': master_name, |
| 202 'bots': bot_name, | 211 'bots': bot_name, |
| 203 'tests': test_name, | 212 'tests': test_name, |
| 204 'rev': point_id | 213 'rev': point_id |
| 205 }) | 214 }) |
| 206 print 'Results Dashboard: %s/report?%s' % (upload_url, dashboard_params) | 215 print 'Results Dashboard: %s/report?%s' % (upload_url, dashboard_params) |
| 207 | 216 |
| 208 return True | 217 return True |
| OLD | NEW |