| 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 23 matching lines...) Expand all Loading... |
| 34 filter_string='-*,blink.console,disabled-by-default-memory-infra') | 34 filter_string='-*,blink.console,disabled-by-default-memory-infra') |
| 35 tbm_options = timeline_based_measurement.Options( | 35 tbm_options = timeline_based_measurement.Options( |
| 36 overhead_level=trace_memory) | 36 overhead_level=trace_memory) |
| 37 tbm_options.config.enable_android_graphics_memtrack = True | 37 tbm_options.config.enable_android_graphics_memtrack = True |
| 38 tbm_options.SetTimelineBasedMetrics(['memoryMetric']) | 38 tbm_options.SetTimelineBasedMetrics(['memoryMetric']) |
| 39 # Setting an empty memory dump config disables periodic dumps. | 39 # Setting an empty memory dump config disables periodic dumps. |
| 40 tbm_options.config.chrome_trace_config.SetMemoryDumpConfig( | 40 tbm_options.config.chrome_trace_config.SetMemoryDumpConfig( |
| 41 chrome_trace_config.MemoryDumpConfig()) | 41 chrome_trace_config.MemoryDumpConfig()) |
| 42 return tbm_options | 42 return tbm_options |
| 43 | 43 |
| 44 def SetExtraBrowserOptions(self, options): | |
| 45 # Just before we measure memory we flush the system caches | |
| 46 # unfortunately this doesn't immediately take effect, instead | |
| 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 | |
| 49 # each time before Chrome starts so we effect even the first page | |
| 50 # - avoiding the bug. | |
| 51 options.clear_sytem_cache_for_browser_and_profile_on_start = True | |
| 52 | |
| 53 | 44 |
| 54 # TODO(bashi): Workaround for http://crbug.com/532075. | 45 # TODO(bashi): Workaround for http://crbug.com/532075. |
| 55 # @benchmark.Enabled('android') shouldn't be needed. | 46 # @benchmark.Enabled('android') shouldn't be needed. |
| 56 @benchmark.Enabled('android') | 47 @benchmark.Enabled('android') |
| 57 class MemoryBenchmarkTop10Mobile(_MemoryInfra): | 48 class MemoryBenchmarkTop10Mobile(_MemoryInfra): |
| 58 """Measure foreground/background memory on top 10 mobile page set. | 49 """Measure foreground/background memory on top 10 mobile page set. |
| 59 | 50 |
| 60 This metric provides memory measurements for the System Health Plan of | 51 This metric provides memory measurements for the System Health Plan of |
| 61 Chrome on Android. | 52 Chrome on Android. |
| 62 """ | 53 """ |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 of long running idle Gmail page """ | 239 of long running idle Gmail page """ |
| 249 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet | 240 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet |
| 250 | 241 |
| 251 @classmethod | 242 @classmethod |
| 252 def Name(cls): | 243 def Name(cls): |
| 253 return 'memory.long_running_idle_gmail_background_tbmv2' | 244 return 'memory.long_running_idle_gmail_background_tbmv2' |
| 254 | 245 |
| 255 @classmethod | 246 @classmethod |
| 256 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 | 247 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 |
| 257 return cls.IsSvelte(possible_browser) | 248 return cls.IsSvelte(possible_browser) |
| OLD | NEW |