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

Unified Diff: tools/telemetry/telemetry/page/page_runner.py

Issue 11428107: Telemetry: extends Platform abstraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: __init__/close() Created 7 years, 10 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
Index: tools/telemetry/telemetry/page/page_runner.py
diff --git a/tools/telemetry/telemetry/page/page_runner.py b/tools/telemetry/telemetry/page/page_runner.py
index 5141fdb90682f435efa212b401dc711fd72e87f0..466bb26a58794933d0c36b2be969c05162851601 100644
--- a/tools/telemetry/telemetry/page/page_runner.py
+++ b/tools/telemetry/telemetry/page/page_runner.py
@@ -142,6 +142,8 @@ class PageRunner(object):
if options.trace_dir:
self._SetupTracingTab(state)
+ self._WaitForThermalThrottlingIfNeeded(state.browser.platform)
+
try:
self._RunPage(options, page, state.tab, test, results)
except exceptions.TabCrashException:
@@ -155,6 +157,8 @@ class PageRunner(object):
logging.warning('Tab crashed: %s%s', page.url, stdout)
state.Close()
+ self._CheckThermalThrottling(state.browser.platform)
+
if options.trace_dir:
self._EndTracing(state, options, page)
@@ -314,6 +318,28 @@ class PageRunner(object):
except Exception:
pass
+ def _WaitForThermalThrottlingIfNeeded(self, platform):
+ if not platform.CanMonitorThermalThrottling():
+ return
+ thermal_throttling_retry = 0
+ while (platform.IsThermallyThrottled() and
+ thermal_throttling_retry < 3):
+ logging.warning('Thermally throttled, waiting (%d)...',
+ thermal_throttling_retry)
+ thermal_throttling_retry += 1
+ time.sleep(thermal_throttling_retry * 2)
+
+ if platform.IsThermallyThrottled():
+ logging.error('Device is thermally throttled before running '
+ 'performance tests, results will vary.')
+
+ def _CheckThermalThrottling(self, platform):
+ if not platform.CanMonitorThermalThrottling():
+ return
+ if platform.HasBeenThermallyThrottled():
+ logging.error('Device has been thermally throttled during '
+ 'performance tests, results will vary.')
+
@staticmethod
def AddCommandLineOptions(parser):
page_filter_module.PageFilter.AddCommandLineOptions(parser)

Powered by Google App Engine
This is Rietveld 408576698