Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import sys | 6 import sys |
| 7 | 7 |
| 8 from telemetry import benchmark | 8 from telemetry import benchmark |
| 9 from telemetry.internal.browser import browser_finder | 9 from telemetry.internal.browser import browser_finder |
| 10 from telemetry.timeline import tracing_category_filter | |
| 11 from telemetry.web_perf import timeline_based_measurement | |
| 10 | 12 |
| 11 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, | 13 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, |
| 12 os.pardir, 'variations')) | 14 os.pardir, 'variations')) |
| 13 import fieldtrial_util # pylint: disable=import-error | 15 import fieldtrial_util # pylint: disable=import-error |
| 14 | 16 |
| 15 | 17 |
| 16 class PerfBenchmark(benchmark.Benchmark): | 18 class PerfBenchmark(benchmark.Benchmark): |
| 17 """ Super class for all benchmarks in src/tools/perf/benchmarks directory. | 19 """ Super class for all benchmarks in src/tools/perf/benchmarks directory. |
| 18 All the perf benchmarks must subclass from this one to to make sure that | 20 All the perf benchmarks must subclass from this one to to make sure that |
| 19 the field trial configs are activated for the browser during benchmark runs. | 21 the field trial configs are activated for the browser during benchmark runs. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 variations_dir = os.path.join(os.path.dirname(__file__), os.pardir, | 53 variations_dir = os.path.join(os.path.dirname(__file__), os.pardir, |
| 52 os.pardir, os.pardir, 'testing', 'variations') | 54 os.pardir, os.pardir, 'testing', 'variations') |
| 53 possible_browser = browser_finder.FindBrowser(finder_options) | 55 possible_browser = browser_finder.FindBrowser(finder_options) |
| 54 if not possible_browser: | 56 if not possible_browser: |
| 55 return [] | 57 return [] |
| 56 | 58 |
| 57 return fieldtrial_util.GenerateArgs( | 59 return fieldtrial_util.GenerateArgs( |
| 58 os.path.join(variations_dir, | 60 os.path.join(variations_dir, |
| 59 'fieldtrial_testing_config_%s.json' % self._FixupTargetOS( | 61 'fieldtrial_testing_config_%s.json' % self._FixupTargetOS( |
| 60 possible_browser.target_os))) | 62 possible_browser.target_os))) |
| 63 | |
| 64 | |
| 65 class _MemoryBenchmark(PerfBenchmark): | |
|
nednguyen
2015/09/01 22:40:17
Err, I suggest you to put _MemoryBenchmark & Rende
bashi
2015/09/01 23:00:36
Ah, I see. Done. Renamed memory_health_plan.py to
| |
| 66 """Base class for timeline based memory benchmark.""" | |
| 67 | |
| 68 def SetExtraBrowserOptions(self, options): | |
| 69 # TODO(perezju): Temporary workaround to disable periodic memory dumps. | |
| 70 # See: http://crbug.com/513692 | |
| 71 options.AppendExtraBrowserArgs('--enable-memory-benchmarking') | |
| 72 | |
| 73 def CreateTimelineBasedMeasurementOptions(self): | |
| 74 # Enable only memory-infra, to get memory dumps, and blink.console, to get | |
| 75 # the timeline markers used for mapping threads to tabs. | |
| 76 trace_memory = tracing_category_filter.TracingCategoryFilter( | |
| 77 filter_string='-*,blink.console,disabled-by-default-memory-infra') | |
| 78 return timeline_based_measurement.Options(overhead_level=trace_memory) | |
| OLD | NEW |