From 971cf77e78f6ebc7296e65c9d15087e948818ee3 Mon Sep 17 00:00:00 2001 From: "jeremy@chromium.org" Date: Wed, 2 Jul 2014 10:11:29 +0000 Subject: [Telemetry] Power metric: subtract quiescent power draw from result Some power measurement backends can only measure global power draw for the whole system and not per-process. Try to get a more exact power measurement by measuring the power draw without the browser running and then subtracting that number from the measurement in the test to try to get a more exact number for how much additional power is being used by the test case. BUG=339180 Review URL: https://codereview.chromium.org/350763005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280994 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/perf/benchmarks/indexeddb_perf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/perf/benchmarks/indexeddb_perf.py') diff --git a/tools/perf/benchmarks/indexeddb_perf.py b/tools/perf/benchmarks/indexeddb_perf.py index cad569b..ec93f9a 100644 --- a/tools/perf/benchmarks/indexeddb_perf.py +++ b/tools/perf/benchmarks/indexeddb_perf.py @@ -38,9 +38,13 @@ class _IndexedDbMeasurement(page_measurement.PageMeasurement): def __init__(self, *args, **kwargs): super(_IndexedDbMeasurement, self).__init__(*args, **kwargs) self._memory_metric = None - self._power_metric = power.PowerMetric() + self._power_metric = None self._v8_object_stats_metric = None + def WillStartBrowser(self, browser): + """Initialize metrics once right before the browser has been launched.""" + self._power_metric = power.PowerMetric(browser) + def DidStartBrowser(self, browser): """Initialize metrics once right after the browser has been launched.""" self._memory_metric = memory.MemoryMetric(browser) -- cgit v1.1