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

Unified Diff: tools/perf/metrics/smoothness.py

Issue 103143007: telemetry: Use trace categories to configure synthetic delays (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added scheduler benchmark and unittest. Created 6 years, 11 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 | « tools/perf/benchmarks/smoothness.py ('k') | tools/perf/metrics/smoothness_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/smoothness.py
diff --git a/tools/perf/metrics/smoothness.py b/tools/perf/metrics/smoothness.py
index 2a5b96e2eccbaf961d8104bd564a7f2d2bbd88f3..ffdd9f0f5c600d204ce0b838dc0f171e0b589544 100644
--- a/tools/perf/metrics/smoothness.py
+++ b/tools/perf/metrics/smoothness.py
@@ -27,6 +27,17 @@ class NoSupportedActionError(page_measurement.MeasurementFailure):
'None of the actions is supported by smoothness measurement')
+def _GetSyntheticDelayCategoriesFromPage(page):
+ if not hasattr(page, 'synthetic_delays'):
+ return []
+ result = []
+ for delay, options in page.synthetic_delays.items():
+ options = '%f;%s' % (options.get('target_duration', 0),
+ options.get('mode', 'static'))
+ result.append('DELAY(%s;%s)' % (delay, options))
+ return result
+
+
class SmoothnessMetric(Metric):
def __init__(self):
super(SmoothnessMetric, self).__init__()
@@ -37,7 +48,9 @@ class SmoothnessMetric(Metric):
self._actions.append(action)
def Start(self, page, tab):
- tab.browser.StartTracing('webkit.console,benchmark', 60)
+ custom_categories = ['webkit.console', 'benchmark']
+ custom_categories += _GetSyntheticDelayCategoriesFromPage(page)
+ tab.browser.StartTracing(','.join(custom_categories), 60)
tab.ExecuteJavaScript('console.time("' + TIMELINE_MARKER + '")')
if tab.browser.platform.IsRawDisplayFrameRateSupported():
tab.browser.platform.StartRawDisplayFrameRateMeasurement()
« no previous file with comments | « tools/perf/benchmarks/smoothness.py ('k') | tools/perf/metrics/smoothness_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698