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

Unified Diff: tools/telemetry/telemetry/core/util.py

Issue 606683005: Telemetry: featurize tab_switching test for compressed swap performance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix "wait for histogram change" condition Created 6 years, 3 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
Index: tools/telemetry/telemetry/core/util.py
diff --git a/tools/telemetry/telemetry/core/util.py b/tools/telemetry/telemetry/core/util.py
index 460eb61ec7fb42bd131ac891b96af6769eaaeef3..5d666e4318ccc536261bbdaa2910c2501e607279 100644
--- a/tools/telemetry/telemetry/core/util.py
+++ b/tools/telemetry/telemetry/core/util.py
@@ -50,10 +50,11 @@ def GetPythonPageSetModule(file_path):
return imp.load_source(_GetUniqueModuleName(), file_path)
-def WaitFor(condition, timeout):
+def WaitFor(condition, timeout, fixed_poll_interval=None):
"""Waits for up to |timeout| secs for the function |condition| to return True.
- Polling frequency is (elapsed_time / 10), with a min of .1s and max of 5s.
+ Polling interval is (elapsed_time / 10), with a min of .1s and max of 5s,
+ unless |fixed_poll_interval| is specified.
Returns:
Result of |condition| function (if present).
@@ -86,7 +87,8 @@ def WaitFor(condition, timeout):
logging.info('Continuing to wait %ds for %s. Elapsed: %ds.',
timeout, GetConditionString(), elapsed_time)
last_output_time = time.time()
- poll_interval = min(max(elapsed_time / 10., min_poll_interval),
+ poll_interval = fixed_poll_interval or \
+ min(max(elapsed_time / 10., min_poll_interval),
max_poll_interval)
time.sleep(poll_interval)

Powered by Google App Engine
This is Rietveld 408576698