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

Unified Diff: tools/telemetry/telemetry/core/platform/power_monitor/powermetrics_power_monitor.py

Issue 322423004: [Telemetry] Decrease `powermetrics` sampling rate on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/power_monitor/powermetrics_power_monitor.py
diff --git a/tools/telemetry/telemetry/core/platform/power_monitor/powermetrics_power_monitor.py b/tools/telemetry/telemetry/core/platform/power_monitor/powermetrics_power_monitor.py
index df89153c2fbc4d4f2cea6db25b78f8f823464415..365013eb4c794c7efa81dee2154f472ccbbcf8e0 100644
--- a/tools/telemetry/telemetry/core/platform/power_monitor/powermetrics_power_monitor.py
+++ b/tools/telemetry/telemetry/core/platform/power_monitor/powermetrics_power_monitor.py
@@ -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):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698