| 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 benchmarks import page_cycler_v2 | 7 from benchmarks import page_cycler_v2 |
| 8 | 8 |
| 9 from core import perf_benchmark | 9 from core import perf_benchmark |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 return options | 52 return options |
| 53 | 53 |
| 54 def CreateStorySet(self, options): | 54 def CreateStorySet(self, options): |
| 55 return page_sets.SystemHealthStorySet(platform=self.PLATFORM) | 55 return page_sets.SystemHealthStorySet(platform=self.PLATFORM) |
| 56 | 56 |
| 57 @classmethod | 57 @classmethod |
| 58 def ShouldTearDownStateAfterEachStoryRun(cls): | 58 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 59 return True | 59 return True |
| 60 | 60 |
| 61 | 61 |
| 62 @benchmark.Owner(emails=['charliea@chromium.org', 'nednguyen@chromium.org']) |
| 62 class DesktopCommonSystemHealth(_CommonSystemHealthBenchmark): | 63 class DesktopCommonSystemHealth(_CommonSystemHealthBenchmark): |
| 63 """Desktop Chrome Energy System Health Benchmark.""" | 64 """Desktop Chrome Energy System Health Benchmark.""" |
| 64 PLATFORM = 'desktop' | 65 PLATFORM = 'desktop' |
| 65 | 66 |
| 66 @classmethod | 67 @classmethod |
| 67 def ShouldDisable(cls, possible_browser): | 68 def ShouldDisable(cls, possible_browser): |
| 68 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | 69 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' |
| 69 | 70 |
| 70 @classmethod | 71 @classmethod |
| 71 def Name(cls): | 72 def Name(cls): |
| 72 return 'system_health.common_desktop' | 73 return 'system_health.common_desktop' |
| 73 | 74 |
| 74 | 75 |
| 75 @benchmark.Enabled('android') | 76 @benchmark.Enabled('android') |
| 77 @benchmark.Owner(emails=['charliea@chromium.org', 'nednguyen@chromium.org']) |
| 76 class MobileCommonSystemHealth(_CommonSystemHealthBenchmark): | 78 class MobileCommonSystemHealth(_CommonSystemHealthBenchmark): |
| 77 """Mobile Chrome Energy System Health Benchmark.""" | 79 """Mobile Chrome Energy System Health Benchmark.""" |
| 78 PLATFORM = 'mobile' | 80 PLATFORM = 'mobile' |
| 79 | 81 |
| 80 @classmethod | 82 @classmethod |
| 81 def Name(cls): | 83 def Name(cls): |
| 82 return 'system_health.common_mobile' | 84 return 'system_health.common_mobile' |
| 83 | 85 |
| 84 | 86 |
| 85 class _MemorySystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 87 class _MemorySystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| (...skipping 25 matching lines...) Expand all Loading... |
| 111 def ShouldTearDownStateAfterEachStoryRun(cls): | 113 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 112 return True | 114 return True |
| 113 | 115 |
| 114 @classmethod | 116 @classmethod |
| 115 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 117 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 116 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 118 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 117 # is able to cope with the data load generated by TBMv2 metrics. | 119 # is able to cope with the data load generated by TBMv2 metrics. |
| 118 return not _IGNORED_STATS_RE.search(value.name) | 120 return not _IGNORED_STATS_RE.search(value.name) |
| 119 | 121 |
| 120 | 122 |
| 123 @benchmark.Owner(emails=['perezju@chromium.org']) |
| 121 class DesktopMemorySystemHealth(_MemorySystemHealthBenchmark): | 124 class DesktopMemorySystemHealth(_MemorySystemHealthBenchmark): |
| 122 """Desktop Chrome Memory System Health Benchmark.""" | 125 """Desktop Chrome Memory System Health Benchmark.""" |
| 123 PLATFORM = 'desktop' | 126 PLATFORM = 'desktop' |
| 124 | 127 |
| 125 @classmethod | 128 @classmethod |
| 126 def ShouldDisable(cls, possible_browser): | 129 def ShouldDisable(cls, possible_browser): |
| 127 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | 130 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' |
| 128 | 131 |
| 129 @classmethod | 132 @classmethod |
| 130 def Name(cls): | 133 def Name(cls): |
| 131 return 'system_health.memory_desktop' | 134 return 'system_health.memory_desktop' |
| 132 | 135 |
| 133 | 136 |
| 134 @benchmark.Enabled('android') | 137 @benchmark.Enabled('android') |
| 138 @benchmark.Owner(emails=['perezju@chromium.org']) |
| 135 class MobileMemorySystemHealth(_MemorySystemHealthBenchmark): | 139 class MobileMemorySystemHealth(_MemorySystemHealthBenchmark): |
| 136 """Mobile Chrome Memory System Health Benchmark.""" | 140 """Mobile Chrome Memory System Health Benchmark.""" |
| 137 PLATFORM = 'mobile' | 141 PLATFORM = 'mobile' |
| 138 | 142 |
| 139 def SetExtraBrowserOptions(self, options): | 143 def SetExtraBrowserOptions(self, options): |
| 140 # Just before we measure memory we flush the system caches | 144 # Just before we measure memory we flush the system caches |
| 141 # unfortunately this doesn't immediately take effect, instead | 145 # unfortunately this doesn't immediately take effect, instead |
| 142 # the next story run is effected. Due to this the first story run | 146 # the next story run is effected. Due to this the first story run |
| 143 # has anomalous results. This option causes us to flush caches | 147 # has anomalous results. This option causes us to flush caches |
| 144 # each time before Chrome starts so we effect even the first story | 148 # each time before Chrome starts so we effect even the first story |
| 145 # - avoiding the bug. | 149 # - avoiding the bug. |
| 146 options.clear_sytem_cache_for_browser_and_profile_on_start = True | 150 options.clear_sytem_cache_for_browser_and_profile_on_start = True |
| 147 | 151 |
| 148 @classmethod | 152 @classmethod |
| 149 def Name(cls): | 153 def Name(cls): |
| 150 return 'system_health.memory_mobile' | 154 return 'system_health.memory_mobile' |
| 151 | 155 |
| 152 | 156 |
| 153 @benchmark.Enabled('android-webview') | 157 @benchmark.Enabled('android-webview') |
| 158 @benchmark.Owner(emails=['perezju@chromium.org', 'torne@chromium.org']) |
| 154 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 159 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| 155 """Webview startup time benchmark | 160 """Webview startup time benchmark |
| 156 | 161 |
| 157 Benchmark that measures how long WebView takes to start up | 162 Benchmark that measures how long WebView takes to start up |
| 158 and load a blank page. Since thie metric only requires the trace | 163 and load a blank page. Since thie metric only requires the trace |
| 159 markers recorded in atrace, Chrome tracing is not enabled for this | 164 markers recorded in atrace, Chrome tracing is not enabled for this |
| 160 benchmark. | 165 benchmark. |
| 161 """ | 166 """ |
| 162 options = {'pageset_repeat': 20} | 167 options = {'pageset_repeat': 20} |
| 163 | 168 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 190 and load a blank page with multiprocess enabled. | 195 and load a blank page with multiprocess enabled. |
| 191 """ | 196 """ |
| 192 | 197 |
| 193 def SetExtraBrowserOptions(self, options): | 198 def SetExtraBrowserOptions(self, options): |
| 194 options.AppendExtraBrowserArgs( | 199 options.AppendExtraBrowserArgs( |
| 195 ['--webview-sandboxed-renderer']) | 200 ['--webview-sandboxed-renderer']) |
| 196 | 201 |
| 197 @classmethod | 202 @classmethod |
| 198 def Name(cls): | 203 def Name(cls): |
| 199 return 'system_health.webview_startup_multiprocess' | 204 return 'system_health.webview_startup_multiprocess' |
| OLD | NEW |