| 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 chrome_trace_category_filter | 10 from telemetry.timeline import chrome_trace_category_filter |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 # Just before we measure memory we flush the system caches | 45 # Just before we measure memory we flush the system caches |
| 46 # unfortunately this doesn't immediately take effect, instead | 46 # unfortunately this doesn't immediately take effect, instead |
| 47 # the next page run is effected. Due to this the first page run | 47 # the next page run is effected. Due to this the first page run |
| 48 # has anomalous results. This option causes us to flush caches | 48 # has anomalous results. This option causes us to flush caches |
| 49 # each time before Chrome starts so we effect even the first page | 49 # each time before Chrome starts so we effect even the first page |
| 50 # - avoiding the bug. | 50 # - avoiding the bug. |
| 51 options.clear_sytem_cache_for_browser_and_profile_on_start = True | 51 options.clear_sytem_cache_for_browser_and_profile_on_start = True |
| 52 | 52 |
| 53 | 53 |
| 54 @benchmark.Enabled('android') # catapult:#3176 | 54 @benchmark.Enabled('android') # catapult:#3176 |
| 55 @benchmark.Owner(emails=['perezju@chromium.org']) |
| 55 class MemoryBenchmarkTop10Mobile(_MemoryInfra): | 56 class MemoryBenchmarkTop10Mobile(_MemoryInfra): |
| 56 """Measure foreground/background memory on top 10 mobile page set. | 57 """Measure foreground/background memory on top 10 mobile page set. |
| 57 | 58 |
| 58 This metric provides memory measurements for the System Health Plan of | 59 This metric provides memory measurements for the System Health Plan of |
| 59 Chrome on Android. | 60 Chrome on Android. |
| 60 """ | 61 """ |
| 61 page_set = page_sets.MemoryTop10Mobile | 62 page_set = page_sets.MemoryTop10Mobile |
| 62 options = {'pageset_repeat': 5} | 63 options = {'pageset_repeat': 5} |
| 63 | 64 |
| 64 @classmethod | 65 @classmethod |
| 65 def Name(cls): | 66 def Name(cls): |
| 66 return 'memory.top_10_mobile' | 67 return 'memory.top_10_mobile' |
| 67 | 68 |
| 68 @classmethod | 69 @classmethod |
| 69 def ShouldTearDownStateAfterEachStoryRun(cls): | 70 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 70 return False | 71 return False |
| 71 | 72 |
| 72 @classmethod | 73 @classmethod |
| 73 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 74 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 74 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 75 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 75 # is able to cope with the data load generated by TBMv2 metrics. | 76 # is able to cope with the data load generated by TBMv2 metrics. |
| 76 return not _IGNORED_STATS_RE.search(value.name) | 77 return not _IGNORED_STATS_RE.search(value.name) |
| 77 | 78 |
| 78 | 79 |
| 79 @benchmark.Enabled('android') # catapult:#3176 | 80 @benchmark.Enabled('android') # catapult:#3176 |
| 81 @benchmark.Owner(emails=['perezju@chromium.org']) |
| 80 class MemoryBenchmarkTop10MobileStress(MemoryBenchmarkTop10Mobile): | 82 class MemoryBenchmarkTop10MobileStress(MemoryBenchmarkTop10Mobile): |
| 81 """Run top 10 mobile page set without closing/restarting the browser. | 83 """Run top 10 mobile page set without closing/restarting the browser. |
| 82 | 84 |
| 83 This benchmark is intended to stress-test the browser, catching memory leaks | 85 This benchmark is intended to stress-test the browser, catching memory leaks |
| 84 or possible crashes after interacting with the browser for a period of time. | 86 or possible crashes after interacting with the browser for a period of time. |
| 85 """ | 87 """ |
| 86 page_set = page_sets.MemoryTop10MobileRealistic | 88 page_set = page_sets.MemoryTop10MobileRealistic |
| 87 | 89 |
| 88 @classmethod | 90 @classmethod |
| 89 def Name(cls): | 91 def Name(cls): |
| 90 return 'memory.top_10_mobile_stress' | 92 return 'memory.top_10_mobile_stress' |
| 91 | 93 |
| 92 @classmethod | 94 @classmethod |
| 93 def ShouldTearDownStateAfterEachStorySetRun(cls): | 95 def ShouldTearDownStateAfterEachStorySetRun(cls): |
| 94 return False | 96 return False |
| 95 | 97 |
| 96 | 98 |
| 97 # Benchmark disabled by default. Force to run with --also-run-disabled-tests. | 99 # Benchmark disabled by default. Force to run with --also-run-disabled-tests. |
| 98 @benchmark.Disabled('all') | 100 @benchmark.Disabled('all') |
| 101 @benchmark.Owner(emails=['perezju@chromium.org']) |
| 99 class DualBrowserBenchmark(_MemoryInfra): | 102 class DualBrowserBenchmark(_MemoryInfra): |
| 100 """Measures memory usage while interacting with two different browsers. | 103 """Measures memory usage while interacting with two different browsers. |
| 101 | 104 |
| 102 The user story involves going back and forth between doing Google searches | 105 The user story involves going back and forth between doing Google searches |
| 103 on a webview-based browser (a stand in for the Search app), and loading | 106 on a webview-based browser (a stand in for the Search app), and loading |
| 104 pages on a select browser. | 107 pages on a select browser. |
| 105 """ | 108 """ |
| 106 page_set = page_sets.DualBrowserStorySet | 109 page_set = page_sets.DualBrowserStorySet |
| 107 options = {'pageset_repeat': 5} | 110 options = {'pageset_repeat': 5} |
| 108 | 111 |
| 109 @classmethod | 112 @classmethod |
| 110 def Name(cls): | 113 def Name(cls): |
| 111 return 'memory.dual_browser_test' | 114 return 'memory.dual_browser_test' |
| 112 | 115 |
| 113 @classmethod | 116 @classmethod |
| 114 def ShouldTearDownStateAfterEachStoryRun(cls): | 117 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 115 return False | 118 return False |
| 116 | 119 |
| 117 @classmethod | 120 @classmethod |
| 118 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 121 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 119 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 122 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 120 # is able to cope with the data load generated by TBMv2 metrics. | 123 # is able to cope with the data load generated by TBMv2 metrics. |
| 121 return not _IGNORED_STATS_RE.search(value.name) | 124 return not _IGNORED_STATS_RE.search(value.name) |
| 122 | 125 |
| 123 | 126 |
| 124 # Benchmark disabled by default. Force to run with --also-run-disabled-tests. | 127 # Benchmark disabled by default. Force to run with --also-run-disabled-tests. |
| 125 @benchmark.Disabled('all') | 128 @benchmark.Disabled('all') |
| 129 @benchmark.Owner(emails=['perezju@chromium.org']) |
| 126 class LongRunningDualBrowserBenchmark(_MemoryInfra): | 130 class LongRunningDualBrowserBenchmark(_MemoryInfra): |
| 127 """Measures memory during prolonged usage of alternating browsers. | 131 """Measures memory during prolonged usage of alternating browsers. |
| 128 | 132 |
| 129 Same as memory.dual_browser_test, but the test is run for 60 iterations | 133 Same as memory.dual_browser_test, but the test is run for 60 iterations |
| 130 and the browser is *not* restarted between page set repeats. | 134 and the browser is *not* restarted between page set repeats. |
| 131 """ | 135 """ |
| 132 page_set = page_sets.DualBrowserStorySet | 136 page_set = page_sets.DualBrowserStorySet |
| 133 options = {'pageset_repeat': 60} | 137 options = {'pageset_repeat': 60} |
| 134 | 138 |
| 135 @classmethod | 139 @classmethod |
| 136 def Name(cls): | 140 def Name(cls): |
| 137 return 'memory.long_running_dual_browser_test' | 141 return 'memory.long_running_dual_browser_test' |
| 138 | 142 |
| 139 @classmethod | 143 @classmethod |
| 140 def ShouldTearDownStateAfterEachStoryRun(cls): | 144 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 141 return False | 145 return False |
| 142 | 146 |
| 143 @classmethod | 147 @classmethod |
| 144 def ShouldTearDownStateAfterEachStorySetRun(cls): | 148 def ShouldTearDownStateAfterEachStorySetRun(cls): |
| 145 return False | 149 return False |
| 146 | 150 |
| 147 @classmethod | 151 @classmethod |
| 148 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 152 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 149 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 153 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 150 # is able to cope with the data load generated by TBMv2 metrics. | 154 # is able to cope with the data load generated by TBMv2 metrics. |
| 151 return not _IGNORED_STATS_RE.search(value.name) | 155 return not _IGNORED_STATS_RE.search(value.name) |
| 152 | 156 |
| 153 | 157 |
| 154 @benchmark.Enabled('android') # catapult:#3176 | 158 @benchmark.Enabled('android') # catapult:#3176 |
| 159 @benchmark.Owner(emails=['bashi@chromium.org']) |
| 155 class RendererMemoryBlinkMemoryMobile(_MemoryInfra): | 160 class RendererMemoryBlinkMemoryMobile(_MemoryInfra): |
| 156 """Timeline based benchmark for measuring memory consumption on mobile | 161 """Timeline based benchmark for measuring memory consumption on mobile |
| 157 sites on which blink's memory consumption is relatively high. | 162 sites on which blink's memory consumption is relatively high. |
| 158 """ | 163 """ |
| 159 page_set = page_sets.BlinkMemoryMobilePageSet | 164 page_set = page_sets.BlinkMemoryMobilePageSet |
| 160 | 165 |
| 161 def SetExtraBrowserOptions(self, options): | 166 def SetExtraBrowserOptions(self, options): |
| 162 super(RendererMemoryBlinkMemoryMobile, self).SetExtraBrowserOptions( | 167 super(RendererMemoryBlinkMemoryMobile, self).SetExtraBrowserOptions( |
| 163 options) | 168 options) |
| 164 options.AppendExtraBrowserArgs([ | 169 options.AppendExtraBrowserArgs([ |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 if 'memory:chrome' in value.name: | 214 if 'memory:chrome' in value.name: |
| 210 # TODO(petrcermak): Remove the first two cases once | 215 # TODO(petrcermak): Remove the first two cases once |
| 211 # https://codereview.chromium.org/2018503002/ lands in Catapult and rolls | 216 # https://codereview.chromium.org/2018503002/ lands in Catapult and rolls |
| 212 # into Chromium. | 217 # into Chromium. |
| 213 return ('renderer:subsystem:v8' in value.name or | 218 return ('renderer:subsystem:v8' in value.name or |
| 214 'renderer:vmstats:overall' in value.name or | 219 'renderer:vmstats:overall' in value.name or |
| 215 bool(cls._V8_AND_OVERALL_MEMORY_RE.search(value.name))) | 220 bool(cls._V8_AND_OVERALL_MEMORY_RE.search(value.name))) |
| 216 return 'v8' in value.name | 221 return 'v8' in value.name |
| 217 | 222 |
| 218 | 223 |
| 224 @benchmark.Owner(emails=['ulan@chromium.org']) |
| 219 class MemoryLongRunningIdleGmail(_MemoryV8Benchmark): | 225 class MemoryLongRunningIdleGmail(_MemoryV8Benchmark): |
| 220 """Use (recorded) real world web sites and measure memory consumption | 226 """Use (recorded) real world web sites and measure memory consumption |
| 221 of long running idle Gmail page """ | 227 of long running idle Gmail page """ |
| 222 page_set = page_sets.LongRunningIdleGmailPageSet | 228 page_set = page_sets.LongRunningIdleGmailPageSet |
| 223 | 229 |
| 224 @classmethod | 230 @classmethod |
| 225 def Name(cls): | 231 def Name(cls): |
| 226 return 'memory.long_running_idle_gmail_tbmv2' | 232 return 'memory.long_running_idle_gmail_tbmv2' |
| 227 | 233 |
| 228 @classmethod | 234 @classmethod |
| 229 def ShouldDisable(cls, possible_browser): | 235 def ShouldDisable(cls, possible_browser): |
| 230 return (cls.IsSvelte(possible_browser) or # http://crbug.com/611167 | 236 return (cls.IsSvelte(possible_browser) or # http://crbug.com/611167 |
| 231 # http://crbug.com/671650 | 237 # http://crbug.com/671650 |
| 232 ((possible_browser.browser_type == 'reference' and | 238 ((possible_browser.browser_type == 'reference' and |
| 233 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5'))) | 239 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5'))) |
| 234 | 240 |
| 235 | 241 |
| 236 @benchmark.Enabled('has tabs') # http://crbug.com/612210 | 242 @benchmark.Enabled('has tabs') # http://crbug.com/612210 |
| 243 @benchmark.Owner(emails=['ulan@chromium.org']) |
| 237 class MemoryLongRunningIdleGmailBackground(_MemoryV8Benchmark): | 244 class MemoryLongRunningIdleGmailBackground(_MemoryV8Benchmark): |
| 238 """Use (recorded) real world web sites and measure memory consumption | 245 """Use (recorded) real world web sites and measure memory consumption |
| 239 of long running idle Gmail page """ | 246 of long running idle Gmail page """ |
| 240 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet | 247 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet |
| 241 | 248 |
| 242 @classmethod | 249 @classmethod |
| 243 def Name(cls): | 250 def Name(cls): |
| 244 return 'memory.long_running_idle_gmail_background_tbmv2' | 251 return 'memory.long_running_idle_gmail_background_tbmv2' |
| 245 | 252 |
| 246 @classmethod | 253 @classmethod |
| 247 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 | 254 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 |
| 248 return cls.IsSvelte(possible_browser) | 255 return cls.IsSvelte(possible_browser) |
| OLD | NEW |