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

Side by Side Diff: tools/perf/measurements/smoothness.py

Issue 23506030: telemetry: Add new metrics to smoothness benchmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/perf/metrics/discrepancy.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 from metrics import loading 4 from metrics import loading
5 from metrics import smoothness 5 from metrics import smoothness
6 from metrics.gpu_rendering_stats import GpuRenderingStats 6 from metrics.gpu_rendering_stats import GpuRenderingStats
7 from telemetry.page import page_measurement 7 from telemetry.page import page_measurement
8 8
9 class DidNotScrollException(page_measurement.MeasurementFailure): 9 class DidNotScrollException(page_measurement.MeasurementFailure):
10 def __init__(self): 10 def __init__(self):
(...skipping 19 matching lines...) Expand all
30 smoothness.SmoothnessMetrics.CustomizeBrowserOptions(options) 30 smoothness.SmoothnessMetrics.CustomizeBrowserOptions(options)
31 if self.force_enable_threaded_compositing: 31 if self.force_enable_threaded_compositing:
32 options.AppendExtraBrowserArgs('--enable-threaded-compositing') 32 options.AppendExtraBrowserArgs('--enable-threaded-compositing')
33 33
34 def CanRunForPage(self, page): 34 def CanRunForPage(self, page):
35 return hasattr(page, 'smoothness') 35 return hasattr(page, 'smoothness')
36 36
37 def WillRunAction(self, page, tab, action): 37 def WillRunAction(self, page, tab, action):
38 # TODO(ernstm): remove 'webkit' category when 38 # TODO(ernstm): remove 'webkit' category when
39 # https://codereview.chromium.org/23848006/ has landed. 39 # https://codereview.chromium.org/23848006/ has landed.
40 tab.browser.StartTracing('webkit,webkit.console,cc,benchmark', 60) 40 tab.browser.StartTracing('webkit,webkit.console,benchmark', 60)
41 if tab.browser.platform.IsRawDisplayFrameRateSupported(): 41 if tab.browser.platform.IsRawDisplayFrameRateSupported():
42 tab.browser.platform.StartRawDisplayFrameRateMeasurement() 42 tab.browser.platform.StartRawDisplayFrameRateMeasurement()
43 self._metrics = smoothness.SmoothnessMetrics(tab) 43 self._metrics = smoothness.SmoothnessMetrics(tab)
44 if action.CanBeBound(): 44 if action.CanBeBound():
45 self._metrics.BindToAction(action) 45 self._metrics.BindToAction(action)
46 else: 46 else:
47 self._metrics.Start() 47 self._metrics.Start()
48 48
49 def DidRunAction(self, page, tab, action): 49 def DidRunAction(self, page, tab, action):
50 if tab.browser.platform.IsRawDisplayFrameRateSupported(): 50 if tab.browser.platform.IsRawDisplayFrameRateSupported():
(...skipping 30 matching lines...) Expand all
81 81
82 if self.options.report_all_results: 82 if self.options.report_all_results:
83 for k, v in rendering_stats_deltas.iteritems(): 83 for k, v in rendering_stats_deltas.iteritems():
84 results.Add(k, '', v) 84 results.Add(k, '', v)
85 85
86 if tab.browser.platform.IsRawDisplayFrameRateSupported(): 86 if tab.browser.platform.IsRawDisplayFrameRateSupported():
87 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): 87 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements():
88 if r.value is None: 88 if r.value is None:
89 raise MissingDisplayFrameRate(r.name) 89 raise MissingDisplayFrameRate(r.name)
90 results.Add(r.name, r.unit, r.value) 90 results.Add(r.name, r.unit, r.value)
OLDNEW
« no previous file with comments | « no previous file | tools/perf/metrics/discrepancy.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698