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 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 | 45 |
46 def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): | 46 def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): |
47 tbm_options.SetLegacyTimelineBasedMetrics(( | 47 tbm_options.SetLegacyTimelineBasedMetrics(( |
48 memory_timeline.MemoryTimelineMetric(), | 48 memory_timeline.MemoryTimelineMetric(), |
49 )) | 49 )) |
50 | 50 |
51 | 51 |
52 # TODO(bashi): Workaround for http://crbug.com/532075 | 52 # TODO(bashi): Workaround for http://crbug.com/532075 |
53 # @benchmark.Enabled('android') shouldn't be needed. | 53 # @benchmark.Enabled('android') shouldn't be needed. |
54 @benchmark.Enabled('android') | 54 @benchmark.Enabled('android') |
55 class MemoryHealthPlan(_MemoryInfra): | 55 class MemoryHealthQuick(_MemoryInfra): |
56 """Timeline based benchmark for the Memory Health Plan.""" | 56 """Timeline based benchmark for the Memory Health Plan (1 iteration).""" |
57 | |
58 _PREFIX_WHITELIST = ('memory_allocator_', 'memory_android_memtrack_', | |
59 'memory_mmaps_', 'process_count_') | |
60 | |
61 page_set = page_sets.MemoryHealthStory | 57 page_set = page_sets.MemoryHealthStory |
62 | 58 |
63 @classmethod | 59 @classmethod |
64 def Name(cls): | 60 def Name(cls): |
65 return 'memory.memory_health_plan' | 61 return 'memory.memory_health_quick' |
66 | |
67 @classmethod | |
68 def ValueCanBeAddedPredicate(cls, value, is_first_result): | |
69 return (value.tir_label in ['foreground', 'background'] | |
70 and any(value.name.startswith(p) for p in cls._PREFIX_WHITELIST)) | |
perezju
2016/04/20 15:17:13
Took the chance to remove this value filter. The b
| |
71 | 62 |
72 @classmethod | 63 @classmethod |
73 def ShouldDisable(cls, possible_browser): | 64 def ShouldDisable(cls, possible_browser): |
74 # Benchmark requires DeskClock app only available on Nexus devices. | 65 # Benchmark requires DeskClock app only available on Nexus devices. |
75 # See http://crbug.com/546842 | 66 # See http://crbug.com/546842 |
76 return 'nexus' not in possible_browser.platform.GetDeviceTypeName().lower() | 67 return 'nexus' not in possible_browser.platform.GetDeviceTypeName().lower() |
77 | 68 |
78 | 69 |
70 # Benchmark is disabled by default because it takes too long to run. | |
71 @benchmark.Disabled('all') | |
72 class MemoryHealthPlan(MemoryHealthQuick): | |
73 """Timeline based benchmark for the Memory Health Plan (5 iterations).""" | |
74 options = {'pageset_repeat': 5} | |
75 | |
76 @classmethod | |
77 def Name(cls): | |
78 return 'memory.memory_health_plan' | |
79 | |
80 | |
79 # TODO(bashi): Workaround for http://crbug.com/532075 | 81 # TODO(bashi): Workaround for http://crbug.com/532075 |
80 # @benchmark.Enabled('android') shouldn't be needed. | 82 # @benchmark.Enabled('android') shouldn't be needed. |
81 @benchmark.Enabled('android') | 83 @benchmark.Enabled('android') |
82 class RendererMemoryBlinkMemoryMobile(_MemoryInfra): | 84 class RendererMemoryBlinkMemoryMobile(_MemoryInfra): |
83 """Timeline based benchmark for measuring memory consumption on mobile | 85 """Timeline based benchmark for measuring memory consumption on mobile |
84 sites on which blink's memory consumption is relatively high.""" | 86 sites on which blink's memory consumption is relatively high.""" |
85 | 87 |
86 _RE_RENDERER_VALUES = re.compile('memory_.+_renderer') | 88 _RE_RENDERER_VALUES = re.compile('memory_.+_renderer') |
87 | 89 |
88 page_set = page_sets.BlinkMemoryMobilePageSet | 90 page_set = page_sets.BlinkMemoryMobilePageSet |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 memory_timeline.MemoryTimelineMetric(), | 147 memory_timeline.MemoryTimelineMetric(), |
146 )) | 148 )) |
147 | 149 |
148 @classmethod | 150 @classmethod |
149 def Name(cls): | 151 def Name(cls): |
150 return 'memory.long_running_idle_gmail_tbm' | 152 return 'memory.long_running_idle_gmail_tbm' |
151 | 153 |
152 @classmethod | 154 @classmethod |
153 def ShouldTearDownStateAfterEachStoryRun(cls): | 155 def ShouldTearDownStateAfterEachStoryRun(cls): |
154 return True | 156 return True |
OLD | NEW |