| 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 |
| 11 from telemetry.web_perf import timeline_based_measurement | 11 from telemetry.web_perf import timeline_based_measurement |
| 12 from telemetry.web_perf.metrics import memory_timeline | 12 from telemetry.web_perf.metrics import memory_timeline |
| 13 | 13 |
| 14 import page_sets | 14 import page_sets |
| 15 | 15 |
| 16 | 16 |
| 17 class _MemoryInfra(perf_benchmark.PerfBenchmark): | 17 class _MemoryInfra(perf_benchmark.PerfBenchmark): |
| 18 """Base class for new-generation memory benchmarks based on memory-infra. | 18 """Base class for new-generation memory benchmarks based on memory-infra. |
| 19 | 19 |
| 20 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which | 20 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which |
| 21 is part of chrome tracing, and extracts it using timeline-based measurements. | 21 is part of chrome tracing, and extracts it using timeline-based measurements. |
| 22 """ | 22 """ |
| 23 | 23 |
| 24 def SetExtraBrowserOptions(self, options): | 24 def SetExtraBrowserOptions(self, options): |
| 25 options.AppendExtraBrowserArgs([ | 25 options.AppendExtraBrowserArgs([ |
| 26 # TODO(perezju): Temporary workaround to disable periodic memory dumps. | 26 # TODO(perezju): Temporary workaround to disable periodic memory dumps. |
| 27 # See: http://crbug.com/513692 | 27 # See: http://crbug.com/513692 |
| 28 '--enable-memory-benchmarking', | 28 '--enable-memory-benchmarking', |
| 29 # TODO(ssid): Remove this flag after fixing http://crbug.com/461788. | |
| 30 '--no-sandbox' | |
| 31 ]) | 29 ]) |
| 32 | 30 |
| 33 def CreateTimelineBasedMeasurementOptions(self): | 31 def CreateTimelineBasedMeasurementOptions(self): |
| 34 # Enable only memory-infra, to get memory dumps, and blink.console, to get | 32 # Enable only memory-infra, to get memory dumps, and blink.console, to get |
| 35 # the timeline markers used for mapping threads to tabs. | 33 # the timeline markers used for mapping threads to tabs. |
| 36 trace_memory = tracing_category_filter.TracingCategoryFilter( | 34 trace_memory = tracing_category_filter.TracingCategoryFilter( |
| 37 filter_string='-*,blink.console,disabled-by-default-memory-infra') | 35 filter_string='-*,blink.console,disabled-by-default-memory-infra') |
| 38 tbm_options = timeline_based_measurement.Options( | 36 tbm_options = timeline_based_measurement.Options( |
| 39 overhead_level=trace_memory) | 37 overhead_level=trace_memory) |
| 40 tbm_options.config.enable_android_graphics_memtrack = True | 38 tbm_options.config.enable_android_graphics_memtrack = True |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. | 108 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. |
| 111 @benchmark.Disabled('reference') | 109 @benchmark.Disabled('reference') |
| 112 class MemoryBenchmarkTop10Mobile(_MemoryInfra): | 110 class MemoryBenchmarkTop10Mobile(_MemoryInfra): |
| 113 """Timeline based benchmark for measuring memory on top 10 mobile sites.""" | 111 """Timeline based benchmark for measuring memory on top 10 mobile sites.""" |
| 114 | 112 |
| 115 page_set = page_sets.MemoryInfraTop10MobilePageSet | 113 page_set = page_sets.MemoryInfraTop10MobilePageSet |
| 116 | 114 |
| 117 @classmethod | 115 @classmethod |
| 118 def Name(cls): | 116 def Name(cls): |
| 119 return 'memory.top_10_mobile' | 117 return 'memory.top_10_mobile' |
| OLD | NEW |