Chromium Code Reviews| 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.web_perf import timeline_based_measurement | 10 from telemetry.web_perf import timeline_based_measurement |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 | 92 |
| 93 def CreateTimelineBasedMeasurementOptions(self): | 93 def CreateTimelineBasedMeasurementOptions(self): |
| 94 options = timeline_based_measurement.Options( | 94 options = timeline_based_measurement.Options( |
| 95 chrome_trace_category_filter.ChromeTraceCategoryFilter( | 95 chrome_trace_category_filter.ChromeTraceCategoryFilter( |
| 96 '-*,disabled-by-default-memory-infra')) | 96 '-*,disabled-by-default-memory-infra')) |
| 97 options.config.enable_android_graphics_memtrack = True | 97 options.config.enable_android_graphics_memtrack = True |
| 98 options.SetTimelineBasedMetrics(['memoryMetric']) | 98 options.SetTimelineBasedMetrics(['memoryMetric']) |
| 99 return options | 99 return options |
| 100 | 100 |
| 101 def CreateStorySet(self, options): | 101 def CreateStorySet(self, options): |
| 102 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, | 102 measure_in_background = self.ShouldBackgroundChrome() |
| 103 take_memory_measurement=True) | 103 return page_sets.SystemHealthStorySet( |
| 104 platform=self.PLATFORM, | |
| 105 take_memory_measurement=True, | |
| 106 measure_in_background=measure_in_background) | |
| 107 | |
| 108 @classmethod | |
| 109 def ShouldBackgroundChrome(cls): | |
| 110 return False | |
| 104 | 111 |
| 105 @classmethod | 112 @classmethod |
| 106 def ShouldTearDownStateAfterEachStoryRun(cls): | 113 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 107 return True | 114 return True |
| 108 | 115 |
| 109 @classmethod | 116 @classmethod |
| 110 def Name(cls): | 117 def Name(cls): |
| 111 return 'system_health.memory_%s' % cls.PLATFORM | 118 if cls.ShouldBackgroundChrome(): |
| 119 return 'system_health.memory_%s_background' % cls.PLATFORM | |
| 120 else: | |
| 121 return 'system_health.memory_%s' % cls.PLATFORM | |
|
perezju
2016/10/05 13:14:54
Instead of adding a new benchmark, I think we shou
perezju
2016/10/05 13:18:10
Ignore that comment. Noise from a previous draft I
| |
| 112 | 122 |
| 113 @classmethod | 123 @classmethod |
| 114 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 124 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 115 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 125 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 116 # is able to cope with the data load generated by TBMv2 metrics. | 126 # is able to cope with the data load generated by TBMv2 metrics. |
| 117 return not _IGNORED_STATS_RE.search(value.name) | 127 return not _IGNORED_STATS_RE.search(value.name) |
| 118 | 128 |
| 119 | 129 |
| 120 class DesktopMemorySystemHealth(_MemorySystemHealthBenchmark): | 130 class DesktopMemorySystemHealth(_MemorySystemHealthBenchmark): |
| 121 """Desktop Chrome Memory System Health Benchmark.""" | 131 """Desktop Chrome Memory System Health Benchmark.""" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 134 | 144 |
| 135 @classmethod | 145 @classmethod |
| 136 def ShouldDisable(cls, possible_browser): | 146 def ShouldDisable(cls, possible_browser): |
| 137 # http://crbug.com/612144 | 147 # http://crbug.com/612144 |
| 138 if (possible_browser.browser_type == 'reference' and | 148 if (possible_browser.browser_type == 'reference' and |
| 139 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): | 149 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): |
| 140 return True | 150 return True |
| 141 | 151 |
| 142 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' | 152 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' |
| 143 | 153 |
| 154 class MobileMemoryBackgroundSystemHealth(MobileMemorySystemHealth): | |
| 155 """Mobile Chrome Background Memory System Health Benchmark.""" | |
| 156 PLATFORM = 'mobile' | |
| 157 | |
| 158 @classmethod | |
| 159 def ShouldBackgroundChrome(cls): | |
| 160 return True | |
| 144 | 161 |
| 145 @benchmark.Enabled('android-webview') | 162 @benchmark.Enabled('android-webview') |
| 146 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 163 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| 147 """Webview startup time benchmark | 164 """Webview startup time benchmark |
| 148 | 165 |
| 149 Benchmark that measures how long WebView takes to start up | 166 Benchmark that measures how long WebView takes to start up |
| 150 and load a blank page. Since thie metric only requires the trace | 167 and load a blank page. Since thie metric only requires the trace |
| 151 markers recorded in atrace, Chrome tracing is not enabled for this | 168 markers recorded in atrace, Chrome tracing is not enabled for this |
| 152 benchmark. | 169 benchmark. |
| 153 """ | 170 """ |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 182 and load a blank page with multiprocess enabled. | 199 and load a blank page with multiprocess enabled. |
| 183 """ | 200 """ |
| 184 | 201 |
| 185 def SetExtraBrowserOptions(self, options): | 202 def SetExtraBrowserOptions(self, options): |
| 186 options.AppendExtraBrowserArgs( | 203 options.AppendExtraBrowserArgs( |
| 187 ['--webview-sandboxed-renderer']) | 204 ['--webview-sandboxed-renderer']) |
| 188 | 205 |
| 189 @classmethod | 206 @classmethod |
| 190 def Name(cls): | 207 def Name(cls): |
| 191 return 'system_health.webview_startup_multiprocess' | 208 return 'system_health.webview_startup_multiprocess' |
| OLD | NEW |