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

Unified Diff: tools/telemetry/telemetry/multi_page_benchmark_runner.py

Issue 11348284: [telemetry] Adding --output-format option to enable more user-friendly output. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/multi_page_benchmark.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/multi_page_benchmark_runner.py
diff --git a/tools/telemetry/telemetry/multi_page_benchmark_runner.py b/tools/telemetry/telemetry/multi_page_benchmark_runner.py
index 89fc5e5c1b8f6bbdb37ff0d2bcdee282eac69b96..002e559c570195c561fd1bac733e2f66f61309c6 100755
--- a/tools/telemetry/telemetry/multi_page_benchmark_runner.py
+++ b/tools/telemetry/telemetry/multi_page_benchmark_runner.py
@@ -34,6 +34,12 @@ def Main(benchmark_dir):
options = browser_options.BrowserOptions()
parser = options.CreateParser('%prog [options] <benchmark> <page_set>')
+ parser.add_option('--output-format',
+ dest='output_format',
+ default='csv',
+ help='Output format. Can be "csv" or "terminal-block". '
+ 'Defaults to "%default".')
+
benchmark = None
if benchmark_name is not None:
benchmark = benchmarks[benchmark_name]()
@@ -60,7 +66,15 @@ def Main(benchmark_dir):
Use --browser=list to figure out which are available.\n"""
sys.exit(1)
- results = multi_page_benchmark.CsvBenchmarkResults(csv.writer(sys.stdout))
+ if options.output_format == 'csv':
+ results = multi_page_benchmark.CsvBenchmarkResults(csv.writer(sys.stdout))
+ elif options.output_format == 'terminal-block':
+ results = multi_page_benchmark.TerminalBlockBenchmarkResults(sys.stdout)
+ else:
+ raise Exception('Invalid --output-format value: "%s". Valid values are '
+ '"csv" and "terminal-block".'
+ % options.output_format)
+
with page_runner.PageRunner(ps) as runner:
runner.Run(options, possible_browser, benchmark, results)
# When using an exact executable, assume it is a reference build for the
« no previous file with comments | « tools/telemetry/telemetry/multi_page_benchmark.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698