Chromium Code Reviews| 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 |