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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which | 25 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which |
26 is part of chrome tracing, and extracts it using timeline-based measurements. | 26 is part of chrome tracing, and extracts it using timeline-based measurements. |
27 """ | 27 """ |
28 | 28 |
29 def SetExtraBrowserOptions(self, options): | 29 def SetExtraBrowserOptions(self, options): |
30 options.AppendExtraBrowserArgs([ | 30 options.AppendExtraBrowserArgs([ |
31 # TODO(perezju): Temporary workaround to disable periodic memory dumps. | 31 # TODO(perezju): Temporary workaround to disable periodic memory dumps. |
32 # See: http://crbug.com/513692 | 32 # See: http://crbug.com/513692 |
33 '--enable-memory-benchmarking', | 33 '--enable-memory-benchmarking', |
| 34 # TODO(ssid): Remove this flag after fixing http://crbug.com/461788. |
| 35 '--no-sandbox', |
34 ]) | 36 ]) |
35 | 37 |
36 def CreateTimelineBasedMeasurementOptions(self): | 38 def CreateTimelineBasedMeasurementOptions(self): |
37 # Enable only memory-infra, to get memory dumps, and blink.console, to get | 39 # Enable only memory-infra, to get memory dumps, and blink.console, to get |
38 # the timeline markers used for mapping threads to tabs. | 40 # the timeline markers used for mapping threads to tabs. |
39 trace_memory = chrome_trace_category_filter.ChromeTraceCategoryFilter( | 41 trace_memory = chrome_trace_category_filter.ChromeTraceCategoryFilter( |
40 filter_string='-*,blink.console,disabled-by-default-memory-infra') | 42 filter_string='-*,blink.console,disabled-by-default-memory-infra') |
41 tbm_options = timeline_based_measurement.Options( | 43 tbm_options = timeline_based_measurement.Options( |
42 overhead_level=trace_memory) | 44 overhead_level=trace_memory) |
43 tbm_options.config.enable_android_graphics_memtrack = True | 45 tbm_options.config.enable_android_graphics_memtrack = True |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 of long running idle Gmail page """ | 218 of long running idle Gmail page """ |
217 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet | 219 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet |
218 | 220 |
219 @classmethod | 221 @classmethod |
220 def Name(cls): | 222 def Name(cls): |
221 return 'memory.long_running_idle_gmail_background_tbmv2' | 223 return 'memory.long_running_idle_gmail_background_tbmv2' |
222 | 224 |
223 @classmethod | 225 @classmethod |
224 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 | 226 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 |
225 return cls.IsSvelte(possible_browser) | 227 return cls.IsSvelte(possible_browser) |
| 228 |
| 229 |
| 230 @benchmark.Enabled('android') |
| 231 class RendererMemoryTest(_MemoryInfra): |
| 232 """Timeline based benchmark for measuring memory consumption on mobile |
| 233 sites on which blink's memory consumption is relatively high.""" |
| 234 |
| 235 TBM_VERSION = 2 |
| 236 |
| 237 page_set = page_sets.MemoryTestPageSet |
| 238 |
| 239 def SetExtraBrowserOptions(self, options): |
| 240 super(RendererMemoryTest, self).SetExtraBrowserOptions( |
| 241 options) |
| 242 options.AppendExtraBrowserArgs([ |
| 243 # Ignore certs errors because record_wpr cannot handle certs correctly |
| 244 # in some cases (e.g. WordPress). |
| 245 '--ignore-certificate-errors', |
| 246 # Add purge-and-suspend-time. |
| 247 '--purge-and-suspend-time=10', |
| 248 '--enable-heap-profiling', |
| 249 ]) |
| 250 |
| 251 @classmethod |
| 252 def Name(cls): |
| 253 return 'memory.memory_test' |
| 254 |
| 255 @classmethod |
| 256 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 257 return (not _IGNORED_STATS_RE.search(value.name) and |
| 258 'renderer_processes' in value.name) |
OLD | NEW |