OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 from telemetry import benchmark | 8 from telemetry import benchmark |
9 from telemetry.timeline import chrome_trace_category_filter | 9 from telemetry.timeline import chrome_trace_category_filter |
| 10 from telemetry.timeline import chrome_trace_config |
10 from telemetry.web_perf import timeline_based_measurement | 11 from telemetry.web_perf import timeline_based_measurement |
11 import page_sets | 12 import page_sets |
12 | 13 |
13 | 14 |
14 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() | 15 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() |
15 # https://github.com/catapult-project/catapult/blob/master/tracing/tracing/value
/numeric.html#L323 | 16 # https://github.com/catapult-project/catapult/blob/master/tracing/tracing/value
/numeric.html#L323 |
16 _IGNORED_STATS_RE = re.compile(r'_(std|count|max|min|sum|pct_\d{4}(_\d+)?)$') | 17 _IGNORED_STATS_RE = re.compile(r'_(std|count|max|min|sum|pct_\d{4}(_\d+)?)$') |
17 | 18 |
18 | 19 |
19 class _SystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 20 class _SystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 def Name(cls): | 57 def Name(cls): |
57 return 'system_health.key_mobile_sites' | 58 return 'system_health.key_mobile_sites' |
58 | 59 |
59 | 60 |
60 class _MemorySystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 61 class _MemorySystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
61 """Chrome Memory System Health Benchmark. | 62 """Chrome Memory System Health Benchmark. |
62 | 63 |
63 https://goo.gl/Jek2NL. | 64 https://goo.gl/Jek2NL. |
64 """ | 65 """ |
65 | 66 |
66 def SetExtraBrowserOptions(self, options): | |
67 options.AppendExtraBrowserArgs([ | |
68 # TODO(perezju): Temporary workaround to disable periodic memory dumps. | |
69 # See: http://crbug.com/513692 | |
70 '--enable-memory-benchmarking', | |
71 ]) | |
72 | |
73 def CreateTimelineBasedMeasurementOptions(self): | 67 def CreateTimelineBasedMeasurementOptions(self): |
74 options = timeline_based_measurement.Options( | 68 options = timeline_based_measurement.Options( |
75 chrome_trace_category_filter.ChromeTraceCategoryFilter( | 69 chrome_trace_category_filter.ChromeTraceCategoryFilter( |
76 '-*,disabled-by-default-memory-infra')) | 70 '-*,disabled-by-default-memory-infra')) |
77 options.config.enable_android_graphics_memtrack = True | 71 options.config.enable_android_graphics_memtrack = True |
78 options.SetTimelineBasedMetrics(['memoryMetric']) | 72 options.SetTimelineBasedMetrics(['memoryMetric']) |
| 73 # Setting an empty memory dump config disables periodic dumps. |
| 74 options.config.chrome_trace_config.SetMemoryDumpConfig( |
| 75 chrome_trace_config.MemoryDumpConfig()) |
79 return options | 76 return options |
80 | 77 |
81 def CreateStorySet(self, options): | 78 def CreateStorySet(self, options): |
82 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, | 79 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, |
83 take_memory_measurement=True) | 80 take_memory_measurement=True) |
84 | 81 |
85 @classmethod | 82 @classmethod |
86 def Name(cls): | 83 def Name(cls): |
87 return 'system_health.memory_%s' % cls.PLATFORM | 84 return 'system_health.memory_%s' % cls.PLATFORM |
88 | 85 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 options.config.atrace_config.app_name = 'org.chromium.webview_shell' | 134 options.config.atrace_config.app_name = 'org.chromium.webview_shell' |
138 return options | 135 return options |
139 | 136 |
140 @classmethod | 137 @classmethod |
141 def ShouldTearDownStateAfterEachStoryRun(cls): | 138 def ShouldTearDownStateAfterEachStoryRun(cls): |
142 return True | 139 return True |
143 | 140 |
144 @classmethod | 141 @classmethod |
145 def Name(cls): | 142 def Name(cls): |
146 return 'system_health.webview_startup' | 143 return 'system_health.webview_startup' |
OLD | NEW |