| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 from telemetry import benchmark | 8 from telemetry import benchmark |
| 9 from telemetry.timeline import chrome_trace_category_filter | 9 from telemetry.timeline import chrome_trace_category_filter |
| 10 from telemetry.timeline import chrome_trace_config | |
| 11 from telemetry.web_perf import timeline_based_measurement | 10 from telemetry.web_perf import timeline_based_measurement |
| 12 import page_sets | 11 import page_sets |
| 13 | 12 |
| 14 | 13 |
| 15 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() | 14 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() |
| 16 # https://github.com/catapult-project/catapult/blob/master/tracing/tracing/value
/numeric.html#L323 | 15 # https://github.com/catapult-project/catapult/blob/master/tracing/tracing/value
/numeric.html#L323 |
| 17 _IGNORED_STATS_RE = re.compile(r'_(std|count|max|min|sum|pct_\d{4}(_\d+)?)$') | 16 _IGNORED_STATS_RE = re.compile(r'_(std|count|max|min|sum|pct_\d{4}(_\d+)?)$') |
| 18 | 17 |
| 19 | 18 |
| 20 class _SystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 19 class _SystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 def Name(cls): | 56 def Name(cls): |
| 58 return 'system_health.key_mobile_sites' | 57 return 'system_health.key_mobile_sites' |
| 59 | 58 |
| 60 | 59 |
| 61 class _MemorySystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 60 class _MemorySystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| 62 """Chrome Memory System Health Benchmark. | 61 """Chrome Memory System Health Benchmark. |
| 63 | 62 |
| 64 https://goo.gl/Jek2NL. | 63 https://goo.gl/Jek2NL. |
| 65 """ | 64 """ |
| 66 | 65 |
| 66 def SetExtraBrowserOptions(self, options): |
| 67 options.AppendExtraBrowserArgs([ |
| 68 # TODO(perezju): Temporary workaround to disable periodic memory dumps. |
| 69 # See: http://crbug.com/513692 |
| 70 '--enable-memory-benchmarking', |
| 71 ]) |
| 72 |
| 67 def CreateTimelineBasedMeasurementOptions(self): | 73 def CreateTimelineBasedMeasurementOptions(self): |
| 68 options = timeline_based_measurement.Options( | 74 options = timeline_based_measurement.Options( |
| 69 chrome_trace_category_filter.ChromeTraceCategoryFilter( | 75 chrome_trace_category_filter.ChromeTraceCategoryFilter( |
| 70 '-*,disabled-by-default-memory-infra')) | 76 '-*,disabled-by-default-memory-infra')) |
| 71 options.config.enable_android_graphics_memtrack = True | 77 options.config.enable_android_graphics_memtrack = True |
| 72 options.SetTimelineBasedMetrics(['memoryMetric']) | 78 options.SetTimelineBasedMetrics(['memoryMetric']) |
| 73 # Setting an empty memory dump config disables periodic dumps. | |
| 74 options.config.chrome_trace_config.SetMemoryDumpConfig( | |
| 75 chrome_trace_config.MemoryDumpConfig()) | |
| 76 return options | 79 return options |
| 77 | 80 |
| 78 def CreateStorySet(self, options): | 81 def CreateStorySet(self, options): |
| 79 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, | 82 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, |
| 80 take_memory_measurement=True) | 83 take_memory_measurement=True) |
| 81 | 84 |
| 82 @classmethod | 85 @classmethod |
| 83 def Name(cls): | 86 def Name(cls): |
| 84 return 'system_health.memory_%s' % cls.PLATFORM | 87 return 'system_health.memory_%s' % cls.PLATFORM |
| 85 | 88 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 options.config.atrace_config.app_name = 'org.chromium.webview_shell' | 137 options.config.atrace_config.app_name = 'org.chromium.webview_shell' |
| 135 return options | 138 return options |
| 136 | 139 |
| 137 @classmethod | 140 @classmethod |
| 138 def ShouldTearDownStateAfterEachStoryRun(cls): | 141 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 139 return True | 142 return True |
| 140 | 143 |
| 141 @classmethod | 144 @classmethod |
| 142 def Name(cls): | 145 def Name(cls): |
| 143 return 'system_health.webview_startup' | 146 return 'system_health.webview_startup' |
| OLD | NEW |