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

Unified Diff: tools/perf/page_sets/system_health/system_health_story.py

Issue 2248693002: [system-health] Wait for 10 seconds after each story (except for memory benchmarks) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't modify memory benchmarks yet Created 4 years, 4 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/perf/page_sets/system_health/system_health_story.py
diff --git a/tools/perf/page_sets/system_health/system_health_story.py b/tools/perf/page_sets/system_health/system_health_story.py
index 1642e44eddbac2eb73dae038b448f7ebba513036..106adc83e030b0aa34fa5ab99a45c2fcbedac06c 100644
--- a/tools/perf/page_sets/system_health/system_health_story.py
+++ b/tools/perf/page_sets/system_health/system_health_story.py
@@ -2,14 +2,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import logging
-
from page_sets.system_health import platforms
from telemetry.page import page
-_DUMP_WAIT_TIME = 3
+# Extra wait time after the page has loaded required by the loading metric. We
+# use it in all benchmarks to avoid divergence between benchmarks.
+# TODO(petrcermak): Switch the memory benchmarks to use it as well.
+_WAIT_TIME_AFTER_LOAD = 10
class _MetaSystemHealthStory(type):
@@ -46,19 +47,18 @@ class SystemHealthStory(page.Page):
self._take_memory_measurement = take_memory_measurement
def _Measure(self, action_runner):
+ if self._ShouldMeasureMemory(action_runner):
+ action_runner.MeasureMemory(deterministic_mode=True)
+ else:
+ action_runner.Wait(_WAIT_TIME_AFTER_LOAD)
+
+ def _ShouldMeasureMemory(self, action_runner):
if not self._take_memory_measurement:
- return
- # TODO(petrcermak): This method is essentially the same as
- # MemoryHealthPage._TakeMemoryMeasurement() in memory_health_story.py.
- # Consider sharing the common code.
- action_runner.Wait(_DUMP_WAIT_TIME)
- action_runner.ForceGarbageCollection()
- action_runner.Wait(_DUMP_WAIT_TIME)
+ return False
tracing_controller = action_runner.tab.browser.platform.tracing_controller
if not tracing_controller.is_tracing_running:
- return # Tracing is not running, e.g., when recording a WPR archive.
- if not action_runner.tab.browser.DumpMemory():
- logging.error('Unable to get a memory dump for %s.', self.name)
+ return False # Tracing is not running, e.g. when recording a WPR archive.
+ return True
perezju 2016/08/17 16:24:45 This check is already happening within MeasureMemo
petrcermak 2016/08/23 14:34:39 We actually need this for when we record the stori
def _Login(self, action_runner):
pass
« 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