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

Side by Side Diff: tools/telemetry/telemetry/benchmark_runner.py

Issue 1405573002: Telemetry: Print the sorted benchmark list when running run_benchmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | tools/telemetry/telemetry/benchmark_runner_unittest.py » ('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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Parses the command line, discovers the appropriate benchmarks, and runs them. 5 """Parses the command line, discovers the appropriate benchmarks, and runs them.
6 6
7 Handles benchmark configuration, but all the logic for 7 Handles benchmark configuration, but all the logic for
8 actually running the benchmark is in Benchmark and PageRunner.""" 8 actually running the benchmark is in Benchmark and PageRunner."""
9 9
10 import hashlib 10 import hashlib
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 b = None # Need this to stop pylint from complaining undefined variable. 62 b = None # Need this to stop pylint from complaining undefined variable.
63 if any(not issubclass(b, benchmark.Benchmark) for b in benchmarks): 63 if any(not issubclass(b, benchmark.Benchmark) for b in benchmarks):
64 assert False, '|benchmarks| param contains non benchmark class: %s' % b 64 assert False, '|benchmarks| param contains non benchmark class: %s' % b
65 65
66 # Align the benchmark names to the longest one. 66 # Align the benchmark names to the longest one.
67 format_string = ' %%-%ds %%s' % max(len(b.Name()) for b in benchmarks) 67 format_string = ' %%-%ds %%s' % max(len(b.Name()) for b in benchmarks)
68 disabled_benchmarks = [] 68 disabled_benchmarks = []
69 69
70 print >> output_pipe, 'Available benchmarks %sare:' % ( 70 print >> output_pipe, 'Available benchmarks %sare:' % (
71 'for %s ' % possible_browser.browser_type if possible_browser else '') 71 'for %s ' % possible_browser.browser_type if possible_browser else '')
72
73 # Sort the benchmarks by benchmark name.
74 benchmarks = sorted(benchmarks, key=lambda b: b.Name())
72 for b in benchmarks: 75 for b in benchmarks:
73 if not possible_browser or _IsBenchmarkEnabled(b, possible_browser): 76 if not possible_browser or _IsBenchmarkEnabled(b, possible_browser):
74 print >> output_pipe, format_string % (b.Name(), b.Description()) 77 print >> output_pipe, format_string % (b.Name(), b.Description())
75 else: 78 else:
76 disabled_benchmarks.append(b) 79 disabled_benchmarks.append(b)
77 80
78 if disabled_benchmarks: 81 if disabled_benchmarks:
79 print >> output_pipe, ( 82 print >> output_pipe, (
80 '\nDisabled benchmarks for %s are (force run with -d):' % 83 '\nDisabled benchmarks for %s are (force run with -d):' %
81 possible_browser.browser_type) 84 possible_browser.browser_type)
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 396
394 # Parse and run the command. 397 # Parse and run the command.
395 parser = command.CreateParser() 398 parser = command.CreateParser()
396 command.AddCommandLineArgs(parser, environment) 399 command.AddCommandLineArgs(parser, environment)
397 options, args = parser.parse_args() 400 options, args = parser.parse_args()
398 if commands: 401 if commands:
399 args = args[1:] 402 args = args[1:]
400 options.positional_args = args 403 options.positional_args = args
401 command.ProcessCommandLineArgs(parser, options, environment) 404 command.ProcessCommandLineArgs(parser, options, environment)
402 return command().Run(options) 405 return command().Run(options)
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/telemetry/benchmark_runner_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698