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

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

Issue 350763005: [Telemetry] Power metric: subtract quiescent power draw from result (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 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 4
5 from metrics import power 5 from metrics import power
6 from measurements import smoothness_controller 6 from measurements import smoothness_controller
7 from telemetry.page import page_measurement 7 from telemetry.page import page_measurement
8 8
9 9
10 class Smoothness(page_measurement.PageMeasurement): 10 class Smoothness(page_measurement.PageMeasurement):
11 def __init__(self): 11 def __init__(self):
12 super(Smoothness, self).__init__('RunSmoothness') 12 super(Smoothness, self).__init__('RunSmoothness')
13 self._power_metric = None 13 self._power_metric = None
14 self._smoothness_controller = None 14 self._smoothness_controller = None
15 15
16 @classmethod 16 @classmethod
17 def CustomizeBrowserOptions(cls, options): 17 def CustomizeBrowserOptions(cls, options):
18 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') 18 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
19 options.AppendExtraBrowserArgs('--touch-events=enabled') 19 options.AppendExtraBrowserArgs('--touch-events=enabled')
20 power.PowerMetric.CustomizeBrowserOptions(options) 20 power.PowerMetric.CustomizeBrowserOptions(options)
21 21
22 def WillStartBrowser(self, browser):
23 self._power_metric = power.PowerMetric(browser)
24
22 def WillRunActions(self, page, tab): 25 def WillRunActions(self, page, tab):
23 self._power_metric = power.PowerMetric()
24 self._power_metric.Start(page, tab) 26 self._power_metric.Start(page, tab)
25 self._smoothness_controller = smoothness_controller.SmoothnessController() 27 self._smoothness_controller = smoothness_controller.SmoothnessController()
26 self._smoothness_controller.Start(page, tab) 28 self._smoothness_controller.Start(page, tab)
27 29
28 def DidRunActions(self, page, tab): 30 def DidRunActions(self, page, tab):
29 self._power_metric.Stop(page, tab) 31 self._power_metric.Stop(page, tab)
30 self._smoothness_controller.Stop(tab) 32 self._smoothness_controller.Stop(tab)
31 33
32 def MeasurePage(self, page, tab, results): 34 def MeasurePage(self, page, tab, results):
33 self._power_metric.AddResults(tab, results) 35 self._power_metric.AddResults(tab, results)
34 self._smoothness_controller.AddResults(tab, results) 36 self._smoothness_controller.AddResults(tab, results)
35 37
36 def CleanUpAfterPage(self, _, tab): 38 def CleanUpAfterPage(self, _, tab):
37 self._smoothness_controller.CleanUp(tab) 39 self._smoothness_controller.CleanUp(tab)
OLDNEW
« no previous file with comments | « tools/perf/measurements/page_cycler_unittest.py ('k') | tools/perf/measurements/smoothness_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698