| 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 re | 5 import re |
| 6 | 6 |
| 7 from core import perf_benchmark | 7 from core import perf_benchmark |
| 8 | 8 |
| 9 from telemetry import benchmark | 9 from telemetry import benchmark |
| 10 from telemetry.timeline import tracing_category_filter | 10 from telemetry.timeline import tracing_category_filter |
| 11 from telemetry.web_perf import timeline_based_measurement | 11 from telemetry.web_perf import timeline_based_measurement |
| 12 | 12 |
| 13 import page_sets | 13 import page_sets |
| 14 | 14 |
| 15 | 15 |
| 16 RE_BENCHMARK_VALUES = re.compile('(fore|back)ground-memory_') | 16 RE_BENCHMARK_VALUES = re.compile('(fore|back)ground-memory_') |
| 17 | 17 |
| 18 | 18 |
| 19 @benchmark.Enabled('android') | 19 @benchmark.Enabled('android') |
| 20 class MemoryHealthPlan(perf_benchmark.PerfBenchmark): | 20 class MemoryHealthPlan(perf_benchmark.PerfBenchmark): |
| 21 """Timeline based benchmark for the Memory Health Plan.""" | 21 """Timeline based benchmark for the Memory Health Plan.""" |
| 22 | 22 |
| 23 page_set = page_sets.MemoryHealthStory | 23 page_set = page_sets.MemoryHealthStory |
| 24 | 24 |
| 25 def CreateTimelineBasedMeasurementOptions(self): | 25 def CreateTimelineBasedMeasurementOptions(self): |
| 26 # blink.console adds the timeline markers used for mapping threads to tabs. |
| 26 trace_memory = tracing_category_filter.TracingCategoryFilter( | 27 trace_memory = tracing_category_filter.TracingCategoryFilter( |
| 27 filter_string='disabled-by-default-memory-infra') | 28 filter_string='-*,blink.console,disabled-by-default-memory-infra') |
| 28 return timeline_based_measurement.Options(overhead_level=trace_memory) | 29 return timeline_based_measurement.Options(overhead_level=trace_memory) |
| 29 | 30 |
| 30 @classmethod | 31 @classmethod |
| 31 def Name(cls): | 32 def Name(cls): |
| 32 return 'memory.memory_health_plan' | 33 return 'memory.memory_health_plan' |
| 33 | 34 |
| 34 @classmethod | 35 @classmethod |
| 35 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 36 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 36 return bool(RE_BENCHMARK_VALUES.match(value.name)) | 37 return bool(RE_BENCHMARK_VALUES.match(value.name)) |
| OLD | NEW |