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 | |
9 from telemetry import benchmark | |
10 from telemetry.timeline import tracing_category_filter | 8 from telemetry.timeline import tracing_category_filter |
11 from telemetry.web_perf import timeline_based_measurement | 9 from telemetry.web_perf import timeline_based_measurement |
12 | 10 |
13 import page_sets | 11 import page_sets |
14 | 12 |
15 | 13 |
16 RE_BENCHMARK_VALUES = re.compile('(fore|back)ground-memory_') | 14 _RENDERER_MEMORY_VALUE_REGEXP = re.compile('.+-memory_.+_renderer') |
17 | 15 |
18 | 16 |
19 @benchmark.Enabled('android') | 17 class RendererMemoryBlinkMemoryMobile(perf_benchmark.PerfBenchmark): |
20 class MemoryHealthPlan(perf_benchmark.PerfBenchmark): | 18 """Timeline based benchmark for measuring memory consumption on mobile |
21 """Timeline based benchmark for the Memory Health Plan.""" | 19 sites on which blink's memory consumption is relatively high.""" |
22 | 20 |
23 page_set = page_sets.MemoryHealthStory | 21 page_set = page_sets.BlinkMemoryMobilePageSet |
24 | 22 |
25 def SetExtraBrowserOptions(self, options): | 23 def SetExtraBrowserOptions(self, options): |
26 # TODO(perezju): Temporary workaround to disable periodic memory dumps. | 24 # TODO(bashi): Remove this workaround, see http://crbug.com/513692 |
27 # See: http://crbug.com/513692 | |
28 options.AppendExtraBrowserArgs('--enable-memory-benchmarking') | 25 options.AppendExtraBrowserArgs('--enable-memory-benchmarking') |
perezju
2015/08/28 12:54:32
I worry a bit about duplicating these temporary wo
bashi
2015/08/31 23:47:28
Sounds a good idea. Done. Ned, what do you think?
nednguyen
2015/09/01 17:52:38
caveat: the naming should be perf_benchmark._Memor
bashi
2015/09/01 22:37:00
Done. But I got following lint warning.
"Access t
| |
29 | 26 |
30 def CreateTimelineBasedMeasurementOptions(self): | 27 def CreateTimelineBasedMeasurementOptions(self): |
31 # Enable only memory-infra, to get memory dumps, and blink.console, to get | 28 # See the comment in MemoryHealthPlan.CreateTimelineBasedMeasurementOptions |
32 # the timeline markers used for mapping threads to tabs. | |
33 trace_memory = tracing_category_filter.TracingCategoryFilter( | 29 trace_memory = tracing_category_filter.TracingCategoryFilter( |
34 filter_string='-*,blink.console,disabled-by-default-memory-infra') | 30 filter_string='-*,blink.console,disabled-by-default-memory-infra') |
35 return timeline_based_measurement.Options(overhead_level=trace_memory) | 31 return timeline_based_measurement.Options(overhead_level=trace_memory) |
perezju
2015/08/28 12:54:32
Same as above, maybe move to a perf_benchmark.Memr
bashi
2015/08/31 23:47:28
Done.
| |
36 | 32 |
37 @classmethod | 33 @classmethod |
38 def Name(cls): | 34 def Name(cls): |
39 return 'memory.memory_health_plan' | 35 return 'renderer_memory.blink_memory_mobile' |
40 | 36 |
41 @classmethod | 37 @classmethod |
42 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 38 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
43 return bool(RE_BENCHMARK_VALUES.match(value.name)) | 39 return bool(_RENDERER_MEMORY_VALUE_REGEXP.match(value.name)) |
OLD | NEW |