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

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

Issue 531973002: [Telemetry] Add option to output Chart JSON summary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Ned's comments Created 6 years, 3 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 | « no previous file | tools/telemetry/telemetry/results/results_options.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/benchmark.py
diff --git a/tools/telemetry/telemetry/benchmark.py b/tools/telemetry/telemetry/benchmark.py
index e10b518f7157c28cba20331464bf57ef1198f1fc..2a8ae336c1febe25fdfcf462cf8a81f6598ae7b9 100644
--- a/tools/telemetry/telemetry/benchmark.py
+++ b/tools/telemetry/telemetry/benchmark.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import json
import logging
import optparse
import os
@@ -17,6 +18,7 @@ from telemetry.page import page_runner
from telemetry.page import page_set
from telemetry.page import page_test
from telemetry.page import test_expectations
+from telemetry.results import chart_json
from telemetry.results import results_options
from telemetry.util import cloud_storage
@@ -89,13 +91,20 @@ class Benchmark(command_line.Command):
self._DownloadGeneratedProfileArchive(finder_options)
- results = results_options.CreateResults(self.GetMetadata(), finder_options)
+ benchmark_metadata = self.GetMetadata()
+ results = results_options.CreateResults(benchmark_metadata, finder_options)
try:
page_runner.Run(pt, ps, expectations, finder_options, results)
except page_test.TestNotSupportedOnPlatformFailure as failure:
logging.warning(str(failure))
- results.PrintSummary()
+ if finder_options.chartjson:
+ print json.dumps(chart_json.ResultsAsChartDict(
+ benchmark_metadata,
+ results.all_page_specific_values,
+ results.all_summary_values))
+ else:
+ results.PrintSummary()
return len(results.failures)
def _DownloadGeneratedProfileArchive(self, options):
« no previous file with comments | « no previous file | tools/telemetry/telemetry/results/results_options.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698