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

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

Issue 144543007: [Telemetry] Add power usage metric (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fix 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/perf/metrics/power.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 4
5 from metrics import power
5 from metrics import smoothness 6 from metrics import smoothness
6 from telemetry.page import page_measurement 7 from telemetry.page import page_measurement
7 8
9
8 class Smoothness(page_measurement.PageMeasurement): 10 class Smoothness(page_measurement.PageMeasurement):
9 def __init__(self): 11 def __init__(self):
10 super(Smoothness, self).__init__('smoothness') 12 super(Smoothness, self).__init__('smoothness')
11 self._metric = None 13 self._smoothness_metric = None
14 self._power_metric = None
12 15
13 def CustomizeBrowserOptions(self, options): 16 def CustomizeBrowserOptions(self, options):
14 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') 17 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
18 power.PowerMetric.CustomizeBrowserOptions(options)
15 19
16 def CanRunForPage(self, page): 20 def CanRunForPage(self, page):
17 return hasattr(page, 'smoothness') 21 return hasattr(page, 'smoothness')
18 22
19 def WillRunActions(self, page, tab): 23 def WillRunActions(self, page, tab):
20 self._metric = smoothness.SmoothnessMetric() 24 self._power_metric = power.PowerMetric()
21 self._metric.Start(page, tab) 25 self._power_metric.Start(page, tab)
26 self._smoothness_metric = smoothness.SmoothnessMetric()
27 self._smoothness_metric.Start(page, tab)
22 28
23 def DidRunAction(self, page, tab, action): 29 def DidRunAction(self, page, tab, action):
24 self._metric.AddActionToIncludeInMetric(action) 30 self._smoothness_metric.AddActionToIncludeInMetric(action)
25 31
26 def DidRunActions(self, page, tab): 32 def DidRunActions(self, page, tab):
27 self._metric.Stop(page, tab) 33 self._power_metric.Stop(page, tab)
34 self._smoothness_metric.Stop(page, tab)
28 35
29 def MeasurePage(self, page, tab, results): 36 def MeasurePage(self, page, tab, results):
30 self._metric.AddResults(tab, results) 37 self._power_metric.AddResults(tab, results)
38 self._smoothness_metric.AddResults(tab, results)
OLDNEW
« no previous file with comments | « no previous file | tools/perf/metrics/power.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698