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

Side by Side Diff: mojo/devtools/common/mojo_benchmark

Issue 1391013005: Benchmark: `--save-all-traces` argument (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Benchmark 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 | « apps/benchmark/benchmark_app.cc ('k') | 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Runner for Mojo application benchmarks.""" 6 """Runner for Mojo application benchmarks."""
7 7
8 import argparse 8 import argparse
9 import logging 9 import logging
10 import os.path 10 import os.path
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 pass 141 pass
142 return measurement_results 142 return measurement_results
143 143
144 144
145 def main(): 145 def main():
146 parser = argparse.ArgumentParser( 146 parser = argparse.ArgumentParser(
147 formatter_class=argparse.RawDescriptionHelpFormatter, 147 formatter_class=argparse.RawDescriptionHelpFormatter,
148 description=_DESCRIPTION) 148 description=_DESCRIPTION)
149 parser.add_argument('benchmark_list_file', type=file, 149 parser.add_argument('benchmark_list_file', type=file,
150 help='a file listing benchmarks to run') 150 help='a file listing benchmarks to run')
151 parser.add_argument('--save-traces', action='store_true', 151 parser.add_argument('--save-all-traces', action='store_true',
152 help='save the traces produced by benchmarks to disk') 152 help='save the traces produced by benchmarks to disk')
153 perf_dashboard.add_argparse_server_arguments(parser) 153 perf_dashboard.add_argparse_server_arguments(parser)
154 154
155 # Common shell configuration arguments. 155 # Common shell configuration arguments.
156 shell_config.add_shell_arguments(parser) 156 shell_config.add_shell_arguments(parser)
157 script_args = parser.parse_args() 157 script_args = parser.parse_args()
158 config = shell_config.get_shell_config(script_args) 158 config = shell_config.get_shell_config(script_args)
159 159
160 try: 160 try:
161 shell, common_shell_args = shell_arguments.get_shell(config, []) 161 shell, common_shell_args = shell_arguments.get_shell(config, [])
(...skipping 10 matching lines...) Expand all
172 benchmark_name = benchmark_spec['name'] 172 benchmark_name = benchmark_spec['name']
173 173
174 for variant_spec in _generate_benchmark_variants(benchmark_spec): 174 for variant_spec in _generate_benchmark_variants(benchmark_spec):
175 variant_name = variant_spec['variant_name'] 175 variant_name = variant_spec['variant_name']
176 app = variant_spec['app'] 176 app = variant_spec['app']
177 duration = variant_spec['duration'] 177 duration = variant_spec['duration']
178 shell_args = variant_spec.get('shell-args', []) + common_shell_args 178 shell_args = variant_spec.get('shell-args', []) + common_shell_args
179 measurements = variant_spec['measurements'] 179 measurements = variant_spec['measurements']
180 180
181 output_file = None 181 output_file = None
182 if script_args.save_traces: 182 if script_args.save_all_traces:
183 output_file = 'benchmark-%s-%s-%s.trace' % ( 183 output_file = 'benchmark-%s-%s-%s.trace' % (
184 benchmark_name.replace(' ', '_'), 184 benchmark_name.replace(' ', '_'),
185 variant_name.replace(' ', '_'), 185 variant_name.replace(' ', '_'),
186 time.strftime('%Y%m%d%H%M%S')) 186 time.strftime('%Y%m%d%H%M%S'))
187 187
188 chart_data_recorder = None 188 chart_data_recorder = None
189 if script_args.upload: 189 if script_args.upload:
190 chart_data_recorder = perf_dashboard.ChartDataRecorder( 190 chart_data_recorder = perf_dashboard.ChartDataRecorder(
191 script_args.test_name) 191 script_args.test_name)
192 192
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 perf_dashboard.upload_chart_data( 231 perf_dashboard.upload_chart_data(
232 script_args.master_name, script_args.bot_name, 232 script_args.master_name, script_args.bot_name,
233 script_args.test_name, script_args.builder_name, 233 script_args.test_name, script_args.builder_name,
234 script_args.build_number, chart_data_recorder.get_chart_data(), 234 script_args.build_number, chart_data_recorder.get_chart_data(),
235 script_args.server_url, script_args.dry_run) 235 script_args.server_url, script_args.dry_run)
236 236
237 return exit_code 237 return exit_code
238 238
239 if __name__ == '__main__': 239 if __name__ == '__main__':
240 sys.exit(main()) 240 sys.exit(main())
OLDNEW
« no previous file with comments | « apps/benchmark/benchmark_app.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698