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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 Chrome on Android. | 55 Chrome on Android. |
56 """ | 56 """ |
57 page_set = page_sets.MemoryTop10Mobile | 57 page_set = page_sets.MemoryTop10Mobile |
58 options = {'pageset_repeat': 5} | 58 options = {'pageset_repeat': 5} |
59 | 59 |
60 @classmethod | 60 @classmethod |
61 def Name(cls): | 61 def Name(cls): |
62 return 'memory.top_10_mobile' | 62 return 'memory.top_10_mobile' |
63 | 63 |
64 @classmethod | 64 @classmethod |
65 def ShouldTearDownStateAfterEachStoryRun(cls): | |
66 return False | |
perezju
2016/09/02 09:31:36
I've just realized we cannot tear down the state o
| |
67 | |
68 @classmethod | |
65 def ShouldDisable(cls, possible_browser): | 69 def ShouldDisable(cls, possible_browser): |
66 # TODO(crbug.com/586148): Benchmark should not depend on DeskClock app. | 70 # TODO(crbug.com/586148): Benchmark should not depend on DeskClock app. |
67 return not possible_browser.platform.CanLaunchApplication( | 71 return not possible_browser.platform.CanLaunchApplication( |
68 'com.google.android.deskclock') | 72 'com.google.android.deskclock') |
69 | 73 |
70 @classmethod | 74 @classmethod |
71 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 75 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
72 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 76 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
73 # is able to cope with the data load generated by TBMv2 metrics. | 77 # is able to cope with the data load generated by TBMv2 metrics. |
74 return not _IGNORED_STATS_RE.search(value.name) | 78 return not _IGNORED_STATS_RE.search(value.name) |
75 | 79 |
76 | 80 |
77 class MemoryBenchmarkTop10MobileStress(MemoryBenchmarkTop10Mobile): | 81 class MemoryBenchmarkTop10MobileStress(MemoryBenchmarkTop10Mobile): |
78 """Run top 10 mobile page set without closing/restarting the browser. | 82 """Run top 10 mobile page set without closing/restarting the browser. |
79 | 83 |
80 This benchmark is intended to stress-test the browser, catching memory leaks | 84 This benchmark is intended to stress-test the browser, catching memory leaks |
81 or possible crashes after interacting with the browser for a period of time. | 85 or possible crashes after interacting with the browser for a period of time. |
82 """ | 86 """ |
83 page_set = page_sets.MemoryTop10MobileRealistic | 87 page_set = page_sets.MemoryTop10MobileRealistic |
84 | 88 |
85 @classmethod | 89 @classmethod |
86 def Name(cls): | 90 def Name(cls): |
87 return 'memory.top_10_mobile_stress' | 91 return 'memory.top_10_mobile_stress' |
88 | 92 |
89 @classmethod | 93 @classmethod |
94 def ShouldTearDownStateAfterEachStoryRun(cls): | |
95 return False | |
petrcermak
2016/09/02 09:40:55
You don't need this here because the class inherit
perezju
2016/09/02 10:53:37
Good catch.
| |
96 | |
97 @classmethod | |
90 def ShouldTearDownStateAfterEachStorySetRun(cls): | 98 def ShouldTearDownStateAfterEachStorySetRun(cls): |
91 return False | 99 return False |
92 | 100 |
93 | 101 |
94 # Benchmark disabled by default. Force to run with --also-run-disabled-tests. | 102 # Benchmark disabled by default. Force to run with --also-run-disabled-tests. |
95 @benchmark.Disabled('all') | 103 @benchmark.Disabled('all') |
96 class DualBrowserBenchmark(_MemoryInfra): | 104 class DualBrowserBenchmark(_MemoryInfra): |
97 """Measures memory usage while interacting with two different browsers. | 105 """Measures memory usage while interacting with two different browsers. |
98 | 106 |
99 The user story involves going back and forth between doing Google searches | 107 The user story involves going back and forth between doing Google searches |
100 on a webview-based browser (a stand in for the Search app), and loading | 108 on a webview-based browser (a stand in for the Search app), and loading |
101 pages on a select browser. | 109 pages on a select browser. |
102 """ | 110 """ |
103 page_set = page_sets.DualBrowserStorySet | 111 page_set = page_sets.DualBrowserStorySet |
104 options = {'pageset_repeat': 5} | 112 options = {'pageset_repeat': 5} |
105 | 113 |
106 @classmethod | 114 @classmethod |
107 def Name(cls): | 115 def Name(cls): |
108 return 'memory.dual_browser_test' | 116 return 'memory.dual_browser_test' |
109 | 117 |
110 @classmethod | 118 @classmethod |
119 def ShouldTearDownStateAfterEachStoryRun(cls): | |
120 return False | |
121 | |
122 @classmethod | |
111 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 123 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
112 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 124 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
113 # is able to cope with the data load generated by TBMv2 metrics. | 125 # is able to cope with the data load generated by TBMv2 metrics. |
114 return not _IGNORED_STATS_RE.search(value.name) | 126 return not _IGNORED_STATS_RE.search(value.name) |
115 | 127 |
116 | 128 |
117 # Benchmark disabled by default. Force to run with --also-run-disabled-tests. | 129 # Benchmark disabled by default. Force to run with --also-run-disabled-tests. |
118 @benchmark.Disabled('all') | 130 @benchmark.Disabled('all') |
119 class LongRunningDualBrowserBenchmark(_MemoryInfra): | 131 class LongRunningDualBrowserBenchmark(_MemoryInfra): |
120 """Measures memory during prolonged usage of alternating browsers. | 132 """Measures memory during prolonged usage of alternating browsers. |
121 | 133 |
122 Same as memory.dual_browser_test, but the test is run for 60 iterations | 134 Same as memory.dual_browser_test, but the test is run for 60 iterations |
123 and the browser is *not* restarted between page set repeats. | 135 and the browser is *not* restarted between page set repeats. |
124 """ | 136 """ |
125 page_set = page_sets.DualBrowserStorySet | 137 page_set = page_sets.DualBrowserStorySet |
126 options = {'pageset_repeat': 60} | 138 options = {'pageset_repeat': 60} |
127 | 139 |
128 @classmethod | 140 @classmethod |
129 def Name(cls): | 141 def Name(cls): |
130 return 'memory.long_running_dual_browser_test' | 142 return 'memory.long_running_dual_browser_test' |
131 | 143 |
132 @classmethod | 144 @classmethod |
145 def ShouldTearDownStateAfterEachStoryRun(cls): | |
146 return False | |
147 | |
148 @classmethod | |
133 def ShouldTearDownStateAfterEachStorySetRun(cls): | 149 def ShouldTearDownStateAfterEachStorySetRun(cls): |
134 return False | 150 return False |
135 | 151 |
136 @classmethod | 152 @classmethod |
137 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 153 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
138 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 154 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
139 # is able to cope with the data load generated by TBMv2 metrics. | 155 # is able to cope with the data load generated by TBMv2 metrics. |
140 return not _IGNORED_STATS_RE.search(value.name) | 156 return not _IGNORED_STATS_RE.search(value.name) |
141 | 157 |
142 | 158 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 of long running idle Gmail page """ | 240 of long running idle Gmail page """ |
225 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet | 241 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet |
226 | 242 |
227 @classmethod | 243 @classmethod |
228 def Name(cls): | 244 def Name(cls): |
229 return 'memory.long_running_idle_gmail_background_tbmv2' | 245 return 'memory.long_running_idle_gmail_background_tbmv2' |
230 | 246 |
231 @classmethod | 247 @classmethod |
232 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 | 248 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 |
233 return cls.IsSvelte(possible_browser) | 249 return cls.IsSvelte(possible_browser) |
OLD | NEW |