| 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 """The page cycler v2. | 5 """The page cycler v2. |
| 6 | 6 |
| 7 For details, see design doc: | 7 For details, see design doc: |
| 8 https://docs.google.com/document/d/1EZQX-x3eEphXupiX-Hq7T4Afju5_sIdxPWYetj7ynd0 | 8 https://docs.google.com/document/d/1EZQX-x3eEphXupiX-Hq7T4Afju5_sIdxPWYetj7ynd0 |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 from core import perf_benchmark | 11 from core import perf_benchmark |
| 12 import page_sets | 12 import page_sets |
| 13 | 13 |
| 14 from benchmarks import metric_dependencies |
| 14 from telemetry import benchmark | 15 from telemetry import benchmark |
| 15 from telemetry.page import cache_temperature | 16 from telemetry.page import cache_temperature |
| 16 from telemetry.web_perf import timeline_based_measurement | 17 from telemetry.web_perf import timeline_based_measurement |
| 17 | 18 |
| 18 | 19 |
| 19 def AugmentOptionsForLoadingMetrics(tbm_options): | |
| 20 cat_filter = tbm_options.config.chrome_trace_config.category_filter | |
| 21 | |
| 22 # "blink.console" is used for marking ranges in | |
| 23 # cache_temperature.MarkTelemetryInternal. | |
| 24 cat_filter.AddIncludedCategory('blink.console') | |
| 25 | |
| 26 # "navigation" and "blink.user_timing" are needed to capture core | |
| 27 # navigation events. | |
| 28 cat_filter.AddIncludedCategory('navigation') | |
| 29 cat_filter.AddIncludedCategory('blink.user_timing') | |
| 30 | |
| 31 # "loading" is needed for first-meaningful-paint computation. | |
| 32 cat_filter.AddIncludedCategory('loading') | |
| 33 | |
| 34 # "toplevel" category is used to capture TaskQueueManager events | |
| 35 # necessary to compute time-to-interactive. | |
| 36 cat_filter.AddIncludedCategory('toplevel') | |
| 37 | |
| 38 tbm_options.AddTimelineBasedMetric('loadingMetric') | |
| 39 return tbm_options | |
| 40 | |
| 41 | |
| 42 class _PageCyclerV2(perf_benchmark.PerfBenchmark): | 20 class _PageCyclerV2(perf_benchmark.PerfBenchmark): |
| 43 options = {'pageset_repeat': 2} | 21 options = {'pageset_repeat': 2} |
| 44 | 22 |
| 45 def CreateTimelineBasedMeasurementOptions(self): | 23 def CreateTimelineBasedMeasurementOptions(self): |
| 46 tbm_options = timeline_based_measurement.Options() | 24 tbm_options = timeline_based_measurement.Options() |
| 47 AugmentOptionsForLoadingMetrics(tbm_options) | 25 tbm_options.SetTimelineBasedMetrics(['loadingMetric']) |
| 26 metric_dependencies.AugmentOptionsForMetrics(tbm_options, ['loadingMetric']) |
| 48 return tbm_options | 27 return tbm_options |
| 49 | 28 |
| 50 @classmethod | 29 @classmethod |
| 51 def ShouldDisable(cls, possible_browser): | 30 def ShouldDisable(cls, possible_browser): |
| 52 # crbug.com/619254 | 31 # crbug.com/619254 |
| 53 if possible_browser.browser_type == 'reference': | 32 if possible_browser.browser_type == 'reference': |
| 54 return True | 33 return True |
| 55 | 34 |
| 56 # crbug.com/616781 | 35 # crbug.com/616781 |
| 57 if (cls.IsSvelte(possible_browser) or | 36 if (cls.IsSvelte(possible_browser) or |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 set, without running in out-of-process iframes mode.. """ | 195 set, without running in out-of-process iframes mode.. """ |
| 217 page_set = page_sets.OopifBasicPageSet | 196 page_set = page_sets.OopifBasicPageSet |
| 218 | 197 |
| 219 @classmethod | 198 @classmethod |
| 220 def Name(cls): | 199 def Name(cls): |
| 221 return 'page_cycler_v2.basic_oopif' | 200 return 'page_cycler_v2.basic_oopif' |
| 222 | 201 |
| 223 def CreateStorySet(self, options): | 202 def CreateStorySet(self, options): |
| 224 return page_sets.OopifBasicPageSet(cache_temperatures=[ | 203 return page_sets.OopifBasicPageSet(cache_temperatures=[ |
| 225 cache_temperature.PCV1_COLD, cache_temperature.PCV1_WARM]) | 204 cache_temperature.PCV1_COLD, cache_temperature.PCV1_WARM]) |
| OLD | NEW |