| 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 tracing_category_filter | 10 from telemetry.timeline import tracing_category_filter |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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 # Subclasses can override this to use TBMv2 instead of TBMv1. | 29 # Subclasses can override this to use TBMv2 instead of TBMv1. |
| 30 TBM_VERSION = 1 | 30 TBM_VERSION = 1 |
| 31 | 31 |
| 32 def SetExtraBrowserOptions(self, options): | 32 def SetExtraBrowserOptions(self, options): |
| 33 options.AppendExtraBrowserArgs([ | 33 options.AppendExtraBrowserArgs([ |
| 34 # TODO(perezju): Temporary workaround to disable periodic memory dumps. | 34 # TODO(perezju): Temporary workaround to disable periodic memory dumps. |
| 35 # See: http://crbug.com/513692 | 35 # See: http://crbug.com/513692 |
| 36 '--enable-memory-benchmarking', | 36 '--no-sandbox', |
| 37 ]) | 37 ]) |
| 38 | 38 |
| 39 def CreateTimelineBasedMeasurementOptions(self): | 39 def CreateTimelineBasedMeasurementOptions(self): |
| 40 # Enable only memory-infra, to get memory dumps, and blink.console, to get | 40 # Enable only memory-infra, to get memory dumps, and blink.console, to get |
| 41 # the timeline markers used for mapping threads to tabs. | 41 # the timeline markers used for mapping threads to tabs. |
| 42 trace_memory = tracing_category_filter.TracingCategoryFilter( | 42 trace_memory = tracing_category_filter.TracingCategoryFilter( |
| 43 filter_string='-*,blink.console,disabled-by-default-memory-infra') | 43 filter_string='-*,blink.console,disabled-by-default-memory-infra') |
| 44 tbm_options = timeline_based_measurement.Options( | 44 tbm_options = timeline_based_measurement.Options( |
| 45 overhead_level=trace_memory) | 45 overhead_level=trace_memory) |
| 46 tbm_options.config.enable_android_graphics_memtrack = True | 46 tbm_options.config.enable_android_graphics_memtrack = True |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 of long running idle Gmail page """ | 200 of long running idle Gmail page """ |
| 201 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet | 201 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet |
| 202 | 202 |
| 203 @classmethod | 203 @classmethod |
| 204 def Name(cls): | 204 def Name(cls): |
| 205 return 'memory.long_running_idle_gmail_background_tbmv2' | 205 return 'memory.long_running_idle_gmail_background_tbmv2' |
| 206 | 206 |
| 207 @classmethod | 207 @classmethod |
| 208 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 | 208 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 |
| 209 return cls.IsSvelte(possible_browser) | 209 return cls.IsSvelte(possible_browser) |
| 210 |
| 211 |
| 212 @benchmark.Enabled('android') |
| 213 class RendererMemoryTest(_MemoryInfra): |
| 214 """Timeline based benchmark for measuring memory consumption on mobile |
| 215 sites on which blink's memory consumption is relatively high.""" |
| 216 |
| 217 _RE_RENDERER_VALUES = re.compile('memory_.+_renderer') |
| 218 |
| 219 page_set = page_sets.TestPageSet |
| 220 |
| 221 def SetExtraBrowserOptions(self, options): |
| 222 super(RendererMemoryTest, self).SetExtraBrowserOptions( |
| 223 options) |
| 224 options.AppendExtraBrowserArgs([ |
| 225 # Ignore certs errors because record_wpr cannot handle certs correctly |
| 226 # in some cases (e.g. WordPress). |
| 227 '--ignore-certificate-errors', |
| 228 ]) |
| 229 |
| 230 @classmethod |
| 231 def Name(cls): |
| 232 return 'memory.test' |
| 233 |
| 234 @classmethod |
| 235 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 236 return bool(cls._RE_RENDERER_VALUES.match(value.name)) |
| OLD | NEW |