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 |
44 | 53 |
45 # TODO(bashi): Workaround for http://crbug.com/532075. | 54 # TODO(bashi): Workaround for http://crbug.com/532075. |
46 # @benchmark.Enabled('android') shouldn't be needed. | 55 # @benchmark.Enabled('android') shouldn't be needed. |
47 @benchmark.Enabled('android') | 56 @benchmark.Enabled('android') |
48 class MemoryBenchmarkTop10Mobile(_MemoryInfra): | 57 class MemoryBenchmarkTop10Mobile(_MemoryInfra): |
49 """Measure foreground/background memory on top 10 mobile page set. | 58 """Measure foreground/background memory on top 10 mobile page set. |
50 | 59 |
51 This metric provides memory measurements for the System Health Plan of | 60 This metric provides memory measurements for the System Health Plan of |
52 Chrome on Android. | 61 Chrome on Android. |
53 """ | 62 """ |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 of long running idle Gmail page """ | 248 of long running idle Gmail page """ |
240 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet | 249 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet |
241 | 250 |
242 @classmethod | 251 @classmethod |
243 def Name(cls): | 252 def Name(cls): |
244 return 'memory.long_running_idle_gmail_background_tbmv2' | 253 return 'memory.long_running_idle_gmail_background_tbmv2' |
245 | 254 |
246 @classmethod | 255 @classmethod |
247 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 | 256 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 |
248 return cls.IsSvelte(possible_browser) | 257 return cls.IsSvelte(possible_browser) |
OLD | NEW |