| 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 |
| 6 |
| 5 from core import perf_benchmark | 7 from core import perf_benchmark |
| 6 from telemetry import benchmark | 8 from telemetry import benchmark |
| 7 from telemetry.timeline import tracing_category_filter | 9 from telemetry.timeline import tracing_category_filter |
| 8 from telemetry.web_perf import timeline_based_measurement | 10 from telemetry.web_perf import timeline_based_measurement |
| 9 import page_sets | 11 import page_sets |
| 10 | 12 |
| 13 |
| 14 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() |
| 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+)?)$') |
| 17 |
| 18 |
| 11 class _SystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 19 class _SystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| 12 TRACING_CATEGORIES = [ | 20 TRACING_CATEGORIES = [ |
| 13 'benchmark', | 21 'benchmark', |
| 14 'navigation', | 22 'navigation', |
| 15 'blink.user_timing', | 23 'blink.user_timing', |
| 16 ] | 24 ] |
| 17 | 25 |
| 18 def CreateTimelineBasedMeasurementOptions(self): | 26 def CreateTimelineBasedMeasurementOptions(self): |
| 19 options = timeline_based_measurement.Options() | 27 options = timeline_based_measurement.Options() |
| 20 options.config.SetTracingCategoryFilter( | 28 options.config.SetTracingCategoryFilter( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 tracing_category_filter.TracingCategoryFilter( | 74 tracing_category_filter.TracingCategoryFilter( |
| 67 '-*,disabled-by-default-memory-infra')) | 75 '-*,disabled-by-default-memory-infra')) |
| 68 options.config.enable_android_graphics_memtrack = True | 76 options.config.enable_android_graphics_memtrack = True |
| 69 options.SetTimelineBasedMetric('memoryMetric') | 77 options.SetTimelineBasedMetric('memoryMetric') |
| 70 return options | 78 return options |
| 71 | 79 |
| 72 @classmethod | 80 @classmethod |
| 73 def Name(cls): | 81 def Name(cls): |
| 74 return 'system_health.memory_%s' % cls.page_set.PLATFORM | 82 return 'system_health.memory_%s' % cls.page_set.PLATFORM |
| 75 | 83 |
| 76 # https://github.com/catapult-project/catapult/issues/2340 | 84 @classmethod |
| 77 @benchmark.Disabled('all') | 85 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 86 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 87 # is able to cope with the data load generated by TBMv2 metrics. |
| 88 return not _IGNORED_STATS_RE.search(value.name) |
| 89 |
| 90 |
| 78 class DesktopMemorySystemHealth(_MemorySystemHealthBenchmark): | 91 class DesktopMemorySystemHealth(_MemorySystemHealthBenchmark): |
| 79 """Desktop Chrome Memory System Health Benchmark.""" | 92 """Desktop Chrome Memory System Health Benchmark.""" |
| 80 page_set = page_sets.DesktopMemorySystemHealthStorySet | 93 page_set = page_sets.DesktopMemorySystemHealthStorySet |
| 81 | 94 |
| 82 @classmethod | 95 @classmethod |
| 83 def ShouldDisable(cls, possible_browser): | 96 def ShouldDisable(cls, possible_browser): |
| 84 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | 97 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' |
| 85 | 98 |
| 86 # https://github.com/catapult-project/catapult/issues/2340 | 99 |
| 87 @benchmark.Disabled('all') | |
| 88 class MobileMemorySystemHealth(_MemorySystemHealthBenchmark): | 100 class MobileMemorySystemHealth(_MemorySystemHealthBenchmark): |
| 89 """Mobile Chrome Memory System Health Benchmark.""" | 101 """Mobile Chrome Memory System Health Benchmark.""" |
| 90 page_set = page_sets.MobileMemorySystemHealthStorySet | 102 page_set = page_sets.MobileMemorySystemHealthStorySet |
| 91 | 103 |
| 92 @classmethod | 104 @classmethod |
| 93 def ShouldDisable(cls, possible_browser): | 105 def ShouldDisable(cls, possible_browser): |
| 94 # http://crbug.com/612144 (reference on Nexus 5X). | 106 # http://crbug.com/612144 (reference on Nexus 5X). |
| 95 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' or ( | 107 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' or ( |
| 96 possible_browser.browser_type == 'reference' and | 108 possible_browser.browser_type == 'reference' and |
| 97 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X') | 109 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X') |
| OLD | NEW |