Index: tools/perf/metrics/power.py |
diff --git a/tools/perf/metrics/power.py b/tools/perf/metrics/power.py |
index 5068c4a5a098388f258eae287e4d7756cf38bc11..596bfd818c54a2975fdc21ff662cb6d35598c3b0 100644 |
--- a/tools/perf/metrics/power.py |
+++ b/tools/perf/metrics/power.py |
@@ -9,11 +9,6 @@ |
from metrics import Metric |
- |
-MONSOON_POWER_LABEL = 'monsoon_energy_consumption_mwh' |
-FUELGAUGE_POWER_LABEL = 'fuel_gauge_energy_consumption_mwh' |
-APP_POWER_LABEL = 'application_energy_consumption_mwh' |
-TOTAL_POWER_LABEL = 'energy_consumption_mwh' |
class PowerMetric(Metric): |
"""A metric for measuring power usage.""" |
@@ -70,7 +65,7 @@ |
time.sleep(measurement_time_s) |
power_results = self._platform.StopMonitoringPower() |
PowerMetric._quiescent_power_draw_mwh = ( |
- power_results.get(TOTAL_POWER_LABEL, 0)) |
+ power_results.get('energy_consumption_mwh', 0)) |
def Start(self, _, tab): |
self._browser = tab.browser |
@@ -104,10 +99,11 @@ |
if not self._results: |
return |
- application_energy_consumption_mwh = self._results.get(APP_POWER_LABEL) |
- total_energy_consumption_mwh = self._results.get(TOTAL_POWER_LABEL) |
- fuel_gauge_energy_consumption_mwh = self._results.get(FUELGAUGE_POWER_LABEL) |
- monsoon_energy_consumption_mwh = self._results.get(MONSOON_POWER_LABEL) |
+ application_energy_consumption_mwh = ( |
+ self._results.get('application_energy_consumption_mwh')) |
+ total_energy_consumption_mwh = self._results.get('energy_consumption_mwh') |
+ fuel_gauge_energy_consumption_mwh = ( |
+ self._results.get('fuel_gauge_energy_consumption_mwh')) |
if (PowerMetric._quiescent_power_draw_mwh and |
application_energy_consumption_mwh is None and |
@@ -118,22 +114,17 @@ |
if fuel_gauge_energy_consumption_mwh is not None: |
results.AddValue(scalar.ScalarValue( |
- results.current_page, FUELGAUGE_POWER_LABEL, 'mWh', |
+ results.current_page, 'fuel_gauge_energy_consumption_mwh', 'mWh', |
fuel_gauge_energy_consumption_mwh)) |
- if monsoon_energy_consumption_mwh is not None: |
- results.AddValue(scalar.ScalarValue( |
- results.current_page, MONSOON_POWER_LABEL, 'mWh', |
- monsoon_energy_consumption_mwh)) |
- |
if total_energy_consumption_mwh is not None: |
results.AddValue(scalar.ScalarValue( |
- results.current_page, TOTAL_POWER_LABEL, 'mWh', |
+ results.current_page, 'energy_consumption_mwh', 'mWh', |
total_energy_consumption_mwh)) |
if application_energy_consumption_mwh is not None: |
results.AddValue(scalar.ScalarValue( |
- results.current_page, APP_POWER_LABEL, 'mWh', |
+ results.current_page, 'application_energy_consumption_mwh', 'mWh', |
application_energy_consumption_mwh)) |
component_utilization = self._results.get('component_utilization', {}) |