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

Unified Diff: tools/telemetry/telemetry/core/platform/mac_platform_backend.py

Issue 675843004: Telemetry: Implement idle wakeups counting on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit Created 6 years, 1 month 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/core/platform/mac_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
index 002d5212de3cafccac3b027770cc8a9b2d1d2922..017828ed74f1892ad03ec25253aaab3d5ed8237e 100644
--- a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
@@ -93,8 +93,7 @@ class MacPlatformBackend(posix_platform_backend.PosixPlatformBackend):
results = {'CpuProcessTime': cpu_time,
'ContextSwitches': proc_info.pti_csw}
- # top only reports idle wakeup count starting from OS X 10.9.
- if self.GetOSVersionName() >= platform_backend.MAVERICKS:
+ if self.CanMeasureIdleWakeUps():
results.update({'IdleWakeupCount': self._GetIdleWakeupCount(pid)})
return results
@@ -165,6 +164,10 @@ class MacPlatformBackend(posix_platform_backend.PosixPlatformBackend):
def CanMonitorPower(self):
return self._power_monitor.CanMonitorPower()
+ def CanMeasureIdleWakeUps(self):
+ # top only reports idle wakeup count starting from OS X 10.9.
+ return self.GetOSVersionName() >= platform_backend.MAVERICKS
+
def CanMeasurePerApplicationPower(self):
return self._power_monitor.CanMeasurePerApplicationPower()
@@ -173,3 +176,11 @@ class MacPlatformBackend(posix_platform_backend.PosixPlatformBackend):
def StopMonitoringPower(self):
return self._power_monitor.StopMonitoringPower()
+
+ def StartMeasuringIdleWakeUps(self):
+ """Do nothing. The idle wake up numbers come from top."""
+ pass
+
+ def StopMeasuringIdleWakeUps(self):
+ """Do nothing. The idle wake up numbers come from top."""
+ pass

Powered by Google App Engine
This is Rietveld 408576698