Commit 2ed32fa8 authored by jeremy@chromium.org's avatar jeremy@chromium.org

[Telemetry] Decrease `powermetrics` sampling rate on Mac

This patch changes the sampling rate of `powermetrics` from 20hz to the default - 5s.  We don't need the extra resolution for our measurements and it seems that increasing the sampling rate draws power in and of itself which affects what's being measured.

BUG=None

Review URL: https://codereview.chromium.org/322423004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276597 0039d316-1c4b-4281-b951-d872f2087c98
parent 1aa05364
......@@ -32,7 +32,6 @@ class PowerMetricsPowerMonitor(power_monitor.PowerMonitor):
def StartMonitoringPower(self, browser):
assert not self._powermetrics_process, (
"Must call StopMonitoringPower().")
SAMPLE_INTERVAL_MS = 1000 / 20 # 20 Hz, arbitrary.
# Empirically powermetrics creates an empty output file immediately upon
# starting. We detect file creation as a signal that measurement has
# started. In order to avoid various race conditions in tempfile creation
......@@ -43,7 +42,6 @@ class PowerMetricsPowerMonitor(power_monitor.PowerMonitor):
self._output_filename = os.path.join(self._output_directory,
'powermetrics.output')
args = ['-f', 'plist',
'-i', '%d' % SAMPLE_INTERVAL_MS,
'-u', self._output_filename]
self._powermetrics_process = self._backend.LaunchApplication(
self.binary_path, args, elevate_privilege=True)
......@@ -52,8 +50,7 @@ class PowerMetricsPowerMonitor(power_monitor.PowerMonitor):
# synchronous in respect to powermetrics starting.
def _OutputFileExists():
return os.path.isfile(self._output_filename)
timeout_sec = 2 * (SAMPLE_INTERVAL_MS / 1000.)
util.WaitFor(_OutputFileExists, timeout_sec)
util.WaitFor(_OutputFileExists, 1)
@decorators.Cache
def CanMonitorPower(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment