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

Unified Diff: mojo/devtools/common/mojo_benchmark

Issue 1406063002: Teach mojo_benchmark to produce chart_data for the perf dashboard. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/devtools/common/devtoolslib/perf_dashboard_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/mojo_benchmark
diff --git a/mojo/devtools/common/mojo_benchmark b/mojo/devtools/common/mojo_benchmark
index 0f2126bceb7b57da1b960c2d70eaa0dd1ecead6a..5ffdbe160c2fe8bd73b7893b2842c337ba1c4e21 100755
--- a/mojo/devtools/common/mojo_benchmark
+++ b/mojo/devtools/common/mojo_benchmark
@@ -14,6 +14,7 @@ import re
from devtoolslib import shell_arguments
from devtoolslib import shell_config
+from devtoolslib import performance_dashboard
_DESCRIPTION = """Runner for Mojo application benchmarks.
@@ -175,6 +176,9 @@ def main():
help='a file listing benchmarks to run')
parser.add_argument('--save-traces', action='store_true',
help='save the traces produced by benchmarks to disk')
+ parser.add_argument('--chart-data-output-file', type=argparse.FileType('w'),
+ help='file to write chart data for the performance '
+ 'dashboard to')
# Common shell configuration arguments.
shell_config.add_shell_arguments(parser)
@@ -191,6 +195,10 @@ def main():
benchmark_list_params = {"target_os": target_os}
exec script_args.benchmark_list_file in benchmark_list_params
+ chart_data_recorder = None
+ if script_args.chart_data_output_file:
+ chart_data_recorder = performance_dashboard.ChartDataRecorder()
+
exit_code = 0
for benchmark_spec in benchmark_list_params['benchmarks']:
for variant_spec in _generate_benchmark_variants(benchmark_spec):
@@ -213,8 +221,13 @@ def main():
# results and preserve the required order.
for measurement_spec in measurements:
if measurement_spec in measurement_results:
- print '%s %s' % (measurement_spec,
- measurement_results[measurement_spec])
+ result = measurement_results[measurement_spec]
+ print '%s %s' % (measurement_spec, result)
+
+ if chart_data_recorder:
+ measurement_name = measurement_spec.replace('/', '-')
+ chart_data_recorder.record_scalar(name, measurement_name, 'ms',
+ result)
else:
print '%s ?' % measurement_spec
some_measurements_failed = True
@@ -230,6 +243,9 @@ def main():
print '-' * 72
exit_code = 1
+ if script_args.chart_data_output_file:
+ script_args.chart_data_output_file.write(chart_data_recorder.get_json())
+
return exit_code
if __name__ == '__main__':
« no previous file with comments | « mojo/devtools/common/devtoolslib/perf_dashboard_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698