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

Unified Diff: telemetry/telemetry/internal/story_runner.py

Issue 2749633004: Track telemetry benchmark cycle time (Closed)
Patch Set: Add tests Created 3 years, 9 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
Index: telemetry/telemetry/internal/story_runner.py
diff --git a/telemetry/telemetry/internal/story_runner.py b/telemetry/telemetry/internal/story_runner.py
index 4242b78b8c85b08ca070dca31aac268441771299..a901832dc1640ba7db58c7acb69d806e12b39fec 100644
--- a/telemetry/telemetry/internal/story_runner.py
+++ b/telemetry/telemetry/internal/story_runner.py
@@ -24,6 +24,7 @@ from telemetry import story as story_module
from telemetry.util import wpr_modes
from telemetry.value import failure
from telemetry.value import skip
+from telemetry.value import scalar
from telemetry.web_perf import story_test
@@ -301,6 +302,7 @@ def RunBenchmark(benchmark, finder_options):
The number of failure values (up to 254) or 255 if there is an uncaught
exception.
"""
+ start = time.time()
benchmark.CustomizeBrowserOptions(finder_options.browser_options)
benchmark_metadata = benchmark.GetMetadata()
@@ -326,7 +328,7 @@ def RunBenchmark(benchmark, finder_options):
results.PrintSummary()
# When a disabled benchmark is run we now want to return success since
# we are no longer filtering these out in the buildbot recipes.
- return 0
+ return 17
pt = benchmark.CreatePageTest(finder_options)
pt.__name__ = benchmark.__class__.__name__
@@ -366,6 +368,8 @@ def RunBenchmark(benchmark, finder_options):
except Exception:
exception_formatter.PrintFormattedException()
return_code = 255
+ finally:
+ duration = time.time() - start
nednguyen 2017/03/17 20:49:32 I mean duration should be after the finally block
try:
if finder_options.upload_results:
@@ -375,6 +379,8 @@ def RunBenchmark(benchmark, finder_options):
results.UploadTraceFilesToCloud(bucket)
results.UploadProfilingFilesToCloud(bucket)
finally:
+ results.AddSummaryValue(scalar.ScalarValue(
+ None, 'BenchmarkDuration', 'minutes', duration / 60))
nednguyen 2017/03/17 20:55:08 nits: divide by 60.0
martiniss 2017/03/23 23:22:21 Done
results.PrintSummary()
return return_code

Powered by Google App Engine
This is Rietveld 408576698