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

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

Issue 222413002: Adding dumpsys based power monitor for android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: W0212 warnings Created 6 years, 9 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
« no previous file with comments | « tools/perf/metrics/power.py ('k') | tools/telemetry/telemetry/core/platform/android_platform_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/__init__.py
diff --git a/tools/telemetry/telemetry/core/platform/__init__.py b/tools/telemetry/telemetry/core/platform/__init__.py
index 76d6401017c9af659e9da150a3f0a1e837657999..902d73bd893836f04f2ff332561c79013805c3d5 100644
--- a/tools/telemetry/telemetry/core/platform/__init__.py
+++ b/tools/telemetry/telemetry/core/platform/__init__.py
@@ -167,48 +167,23 @@ class Platform(object):
for t in self._platform_backend.StopVideoCapture():
yield t
- def CanMonitorPowerSync(self):
- """Returns True iff power can be monitored synchronously via
- MonitorPowerSync().
+ def CanMonitorPower(self):
+ """Returns True iff power can be monitored asynchronously via
+ StartMonitoringPower() and StopMonitoringPower().
"""
- return self._platform_backend.CanMonitorPowerSync()
-
- def MonitorPowerSync(self, duration_ms):
- """Synchronously monitors power for |duration_ms|.
+ return self._platform_backend.CanMonitorPower()
- Returns:
- A dict of power utilization statistics containing: {
- # The instantaneous power (voltage * current) reading in milliwatts at
- # each sample.
- 'power_samples_mw': [mw0, mw1, ..., mwN],
+ def StartMonitoringPower(self, browser):
+ """Starts monitoring power utilization statistics.
- # The total energy consumption during the sampling period in milliwatt
- # hours. May be estimated by integrating power samples or may be exact
- # on supported hardware.
- 'energy_consumption_mwh': mwh,
-
- # A platform-specific dictionary of additional details about the
- # utilization of individual hardware components.
- hw_component_utilization: {
- ...
- }
- }
- """
- return self._platform_backend.MonitorPowerSync(duration_ms)
-
- def CanMonitorPowerAsync(self):
- """Returns True iff power can be monitored asynchronously via
- StartMonitoringPowerAsync() and StopMonitoringPowerAsync().
+ Args:
+ browser: The browser to monitor.
"""
- return self._platform_backend.CanMonitorPowerAsync()
-
- def StartMonitoringPowerAsync(self):
- """Starts monitoring power utilization statistics."""
- assert self._platform_backend.CanMonitorPowerAsync()
- self._platform_backend.StartMonitoringPowerAsync()
+ assert self._platform_backend.CanMonitorPower()
+ self._platform_backend.StartMonitoringPower(browser)
- def StopMonitoringPowerAsync(self):
- """Stops monitoring power utilization and returns collects stats
+ def StopMonitoringPower(self):
+ """Stops monitoring power utilization and returns stats
Returns:
None if power measurement failed for some reason, otherwise a dict of
@@ -233,4 +208,4 @@ class Platform(object):
}
}
"""
- return self._platform_backend.StopMonitoringPowerAsync()
+ return self._platform_backend.StopMonitoringPower()
« no previous file with comments | « tools/perf/metrics/power.py ('k') | tools/telemetry/telemetry/core/platform/android_platform_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698