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..033e1d6b24bb6a84eba9861215d3ae8fcdd8c0c6 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. |
| + TBM_VERSION = 1 |
| + |
| def SetExtraBrowserOptions(self, options): |
| options.AppendExtraBrowserArgs([ |
| # TODO(perezju): Temporary workaround to disable periodic memory dumps. |
| @@ -37,17 +40,20 @@ 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.TBM_VERSION == 1: |
| + # TBMv1 (see telemetry/telemetry/web_perf/metrics/memory_timeline.py |
| + # in third_party/catapult). |
| + tbm_options.SetLegacyTimelineBasedMetrics(( |
| + memory_timeline.MemoryTimelineMetric(), |
| + )) |
| + elif self.TBM_VERSION == 2: |
| + # TBMv2 (see tracing/tracing/metrics/system_health/memory_metric.html |
| + # in third_party/catapult). |
| + tbm_options.SetTimelineBasedMetric('memoryMetric') |
| + else: |
| + raise Exception('Unrecognized TBM version: %s' % self.TBM_VERSION) |
| 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 +84,23 @@ class MemoryHealthPlan(MemoryHealthQuick): |
| return 'memory.memory_health_plan' |
| +@benchmark.Enabled('android') |
| +class TBMv2MemoryBenchmarkTop10Mobile(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. |
|
Primiano Tucci (use gerrit)
2016/04/25 16:14:55
Add a link to crbug.com/606361 which has all the c
petrcermak
2016/04/25 16:31:23
Done.
|
| + """ |
| + TBM_VERSION = 2 |
| + |
| + @classmethod |
| + def Name(cls): |
| + return 'memory.top_10_mobile_tbmv2' |
| + |
| + |
| # TODO(bashi): Workaround for http://crbug.com/532075 |
| # @benchmark.Enabled('android') shouldn't be needed. |
| @benchmark.Enabled('android') |