Chromium Code Reviews| 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.web_perf import timeline_based_measurement | 10 from telemetry.web_perf import timeline_based_measurement |
| 11 import page_sets | 11 import page_sets |
| 12 | 12 |
| 13 | 13 |
| 14 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() | 14 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() |
| 15 # 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 |
| 16 _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+)?)$') |
| 17 | 17 |
| 18 | 18 |
| 19 class _SystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 19 class _SystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
|
nednguyen
2016/07/21 20:08:50
I forgot to comment, why not override ShouldTearDo
petrcermak
2016/07/22 19:37:12
I decided not to do that because _MemorySystemHeal
| |
| 20 TRACING_CATEGORIES = [ | 20 TRACING_CATEGORIES = [ |
| 21 'benchmark', | 21 'benchmark', |
| 22 'navigation', | 22 'navigation', |
| 23 'blink.user_timing', | 23 'blink.user_timing', |
| 24 ] | 24 ] |
| 25 | 25 |
| 26 def CreateTimelineBasedMeasurementOptions(self): | 26 def CreateTimelineBasedMeasurementOptions(self): |
| 27 options = timeline_based_measurement.Options() | 27 options = timeline_based_measurement.Options() |
| 28 options.config.chrome_trace_config.SetCategoryFilter( | 28 options.config.chrome_trace_config.SetCategoryFilter( |
| 29 chrome_trace_category_filter.ChromeTraceCategoryFilter(','.join( | 29 chrome_trace_category_filter.ChromeTraceCategoryFilter(','.join( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 '-*,disabled-by-default-memory-infra')) | 76 '-*,disabled-by-default-memory-infra')) |
| 77 options.config.enable_android_graphics_memtrack = True | 77 options.config.enable_android_graphics_memtrack = True |
| 78 options.SetTimelineBasedMetrics(['memoryMetric']) | 78 options.SetTimelineBasedMetrics(['memoryMetric']) |
| 79 return options | 79 return options |
| 80 | 80 |
| 81 def CreateStorySet(self, options): | 81 def CreateStorySet(self, options): |
| 82 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, | 82 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, |
| 83 take_memory_measurement=True) | 83 take_memory_measurement=True) |
| 84 | 84 |
| 85 @classmethod | 85 @classmethod |
| 86 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 87 return True | |
| 88 | |
| 89 @classmethod | |
| 86 def Name(cls): | 90 def Name(cls): |
| 87 return 'system_health.memory_%s' % cls.PLATFORM | 91 return 'system_health.memory_%s' % cls.PLATFORM |
| 88 | 92 |
| 89 @classmethod | 93 @classmethod |
| 90 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 94 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 91 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 95 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 92 # is able to cope with the data load generated by TBMv2 metrics. | 96 # is able to cope with the data load generated by TBMv2 metrics. |
| 93 return not _IGNORED_STATS_RE.search(value.name) | 97 return not _IGNORED_STATS_RE.search(value.name) |
| 94 | 98 |
| 95 | 99 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 options.config.atrace_config.app_name = 'org.chromium.webview_shell' | 141 options.config.atrace_config.app_name = 'org.chromium.webview_shell' |
| 138 return options | 142 return options |
| 139 | 143 |
| 140 @classmethod | 144 @classmethod |
| 141 def ShouldTearDownStateAfterEachStoryRun(cls): | 145 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 142 return True | 146 return True |
| 143 | 147 |
| 144 @classmethod | 148 @classmethod |
| 145 def Name(cls): | 149 def Name(cls): |
| 146 return 'system_health.webview_startup' | 150 return 'system_health.webview_startup' |
| OLD | NEW |