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

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

Issue 409113006: Don't rely only on __del__ to cleanup PowerMetric when Smoothness.DidRunActions is not called. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | tools/perf/measurements/smoothness_unittest.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 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):
(...skipping 17 matching lines...) Expand all
28 self._smoothness_controller.Start(page, tab) 28 self._smoothness_controller.Start(page, tab)
29 29
30 def DidRunActions(self, page, tab): 30 def DidRunActions(self, page, tab):
31 self._power_metric.Stop(page, tab) 31 self._power_metric.Stop(page, tab)
32 self._smoothness_controller.Stop(tab) 32 self._smoothness_controller.Stop(tab)
33 33
34 def MeasurePage(self, page, tab, results): 34 def MeasurePage(self, page, tab, results):
35 self._power_metric.AddResults(tab, results) 35 self._power_metric.AddResults(tab, results)
36 self._smoothness_controller.AddResults(tab, results) 36 self._smoothness_controller.AddResults(tab, results)
37 37
38 def CleanUpAfterPage(self, _, tab): 38 def CleanUpAfterPage(self, page, tab):
39 self._smoothness_controller.CleanUp(tab) 39 if self._power_metric:
40 self._power_metric.Stop(page, tab)
tonyg 2014/07/22 22:46:12 Doesn't this mean we'll run it twice in the common
chrishenry 2014/07/22 22:56:37 Yes, it's robust to that (_StopInternal is idempot
41 if self._smoothness_controller:
42 self._smoothness_controller.CleanUp(tab)
OLDNEW
« no previous file with comments | « no previous file | tools/perf/measurements/smoothness_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698