Chromium Code Reviews| Index: tools/perf/benchmarks/memory_infra.py |
| diff --git a/tools/perf/benchmarks/memory_infra.py b/tools/perf/benchmarks/memory_infra.py |
| index 40f09ad89e465ad4fa468da18a3ba623007c9e1e..cb4c4b3a4e841c0bf37b7be3ede66940820753b5 100644 |
| --- a/tools/perf/benchmarks/memory_infra.py |
| +++ b/tools/perf/benchmarks/memory_infra.py |
| @@ -22,6 +22,9 @@ class _MemoryInfra(perf_benchmark.PerfBenchmark): |
| is part of chrome tracing, and extracts it using timeline-based measurements. |
| """ |
| + # Subclasses can override this to use TBMv2 instead of TBMv1. |
|
Primiano Tucci (use gerrit)
2016/04/25 15:31:03
Should this say: TMBv1 instead of TBMv2 (IIUC True
petrcermak
2016/04/25 15:59:47
I changed this to be an integer argument to make i
|
| + USE_LEGACY_TBM = True |
| + |
| def SetExtraBrowserOptions(self, options): |
| options.AppendExtraBrowserArgs([ |
| # TODO(perezju): Temporary workaround to disable periodic memory dumps. |
| @@ -37,17 +40,18 @@ class _MemoryInfra(perf_benchmark.PerfBenchmark): |
| tbm_options = timeline_based_measurement.Options( |
| overhead_level=trace_memory) |
| tbm_options.config.enable_android_graphics_memtrack = True |
| + if self.USE_LEGACY_TBM: |
| + # TBMv1 (see telemetry/telemetry/web_perf/metrics/memory_timeline.py |
| + # in third_party/catapult). |
| + tbm_options.SetLegacyTimelineBasedMetrics(( |
| + memory_timeline.MemoryTimelineMetric(), |
| + )) |
| + else: |
| + # TBMv2 (see tracing/tracing/metrics/system_health/memory_metric.html |
| + # in third_party/catapult). |
| + tbm_options.SetTimelineBasedMetric('memoryMetric') |
| return tbm_options |
| - @classmethod |
| - def HasTraceRerunDebugOption(cls): |
| - return True |
| - |
| - def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): |
| - tbm_options.SetLegacyTimelineBasedMetrics(( |
| - memory_timeline.MemoryTimelineMetric(), |
| - )) |
| - |
| # TODO(bashi): Workaround for http://crbug.com/532075 |
| # @benchmark.Enabled('android') shouldn't be needed. |
| @@ -78,6 +82,23 @@ class MemoryHealthPlan(MemoryHealthQuick): |
| return 'memory.memory_health_plan' |
| +#@benchmark.Enabled('android') |
| +class TBMv2MemoryHealthQuick(MemoryHealthQuick): |
| + """Timeline based benchmark for the Memory Health Plan based on TBMv2. |
| + |
| + This is a temporary benchmark to compare the new TBMv2 memory metric |
| + (memory_metric.html) with the existing TBMv1 one (memory_timeline.py). Once |
| + all issues associated with the TBMv2 metric are resolved, all memory |
| + benchmarks (including the ones in this file) will switch to use it instead |
| + of the TBMv1 metric and this temporary benchmark will be removed. |
| + """ |
| + USE_LEGACY_TBM = False |
| + |
| + @classmethod |
| + def Name(cls): |
| + return super(cls, TBMv2MemoryHealthQuick).Name() + '_tbmv2' |
| + |
| + |
| # TODO(bashi): Workaround for http://crbug.com/532075 |
| # @benchmark.Enabled('android') shouldn't be needed. |
| @benchmark.Enabled('android') |