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() |