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

Side by Side Diff: tools/telemetry/telemetry/results/chart_json_output_formatter.py

Issue 946553004: [telemetry] - Rename benchmark_rerun_options to trace_rerun_options. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import collections 5 import collections
6 import itertools 6 import itertools
7 import json 7 import json
8 8
9 from telemetry.results import output_formatter 9 from telemetry.results import output_formatter
10 from telemetry.value import summary as summary_module 10 from telemetry.value import summary as summary_module
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 # This intentionally overwrites the trace if it already exists because this 48 # This intentionally overwrites the trace if it already exists because this
49 # is expected of output from the buildbots currently. 49 # is expected of output from the buildbots currently.
50 # See: crbug.com/413393 50 # See: crbug.com/413393
51 charts[chart_name][trace_name] = value.AsDict() 51 charts[chart_name][trace_name] = value.AsDict()
52 52
53 result_dict = { 53 result_dict = {
54 'format_version': '0.1', 54 'format_version': '0.1',
55 'benchmark_name': benchmark_metadata.name, 55 'benchmark_name': benchmark_metadata.name,
56 'benchmark_description': benchmark_metadata.description, 56 'benchmark_description': benchmark_metadata.description,
57 'benchmark_rerun_options': benchmark_metadata.rerun_options, 57 'trace_rerun_options': benchmark_metadata.rerun_options,
58 'charts': charts, 58 'charts': charts,
59 } 59 }
60 60
61 return result_dict 61 return result_dict
62 62
63 # TODO(eakuefner): Transition this to translate Telemetry JSON. 63 # TODO(eakuefner): Transition this to translate Telemetry JSON.
64 class ChartJsonOutputFormatter(output_formatter.OutputFormatter): 64 class ChartJsonOutputFormatter(output_formatter.OutputFormatter):
65 def __init__(self, output_stream, benchmark_metadata): 65 def __init__(self, output_stream, benchmark_metadata):
66 super(ChartJsonOutputFormatter, self).__init__(output_stream) 66 super(ChartJsonOutputFormatter, self).__init__(output_stream)
67 self._benchmark_metadata = benchmark_metadata 67 self._benchmark_metadata = benchmark_metadata
68 68
69 def Format(self, page_test_results): 69 def Format(self, page_test_results):
70 json.dump(_ResultsAsChartDict( 70 json.dump(_ResultsAsChartDict(
71 self._benchmark_metadata, 71 self._benchmark_metadata,
72 page_test_results.all_page_specific_values, 72 page_test_results.all_page_specific_values,
73 page_test_results.all_summary_values), 73 page_test_results.all_summary_values),
74 self.output_stream, indent=2) 74 self.output_stream, indent=2)
75 self.output_stream.write('\n') 75 self.output_stream.write('\n')
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698