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 """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 telemetry import benchmark | 14 from telemetry import benchmark |
| 15 from telemetry.page import cache_temperature | 15 from telemetry.page import cache_temperature |
| 16 from telemetry.timeline import tracing_category_filter | 16 from telemetry.timeline import tracing_category_filter |
| 17 from telemetry.web_perf import timeline_based_measurement | 17 from telemetry.web_perf import timeline_based_measurement |
| 18 | 18 |
|
nednguyen
2016/06/27 04:33:48
nits: 2 blank lines between top level definitions
kouhei (in TOK)
2016/06/27 04:37:01
Done.
| |
| 19 | 19 # crbug.com/619254 |
| 20 @benchmark.Disabled('reference') | |
| 20 class _PageCyclerV2(perf_benchmark.PerfBenchmark): | 21 class _PageCyclerV2(perf_benchmark.PerfBenchmark): |
| 21 def CreateTimelineBasedMeasurementOptions(self): | 22 def CreateTimelineBasedMeasurementOptions(self): |
| 22 cat_filter = tracing_category_filter.TracingCategoryFilter( | 23 cat_filter = tracing_category_filter.TracingCategoryFilter( |
| 23 filter_string='blink.console,navigation,blink.user_timing,loading') | 24 filter_string='blink.console,navigation,blink.user_timing,loading') |
| 24 | 25 |
| 25 # Below categories are needed for first-meaningful-paint computation. | 26 # Below categories are needed for first-meaningful-paint computation. |
| 26 cat_filter.AddDisabledByDefault('disabled-by-default-blink.debug.layout') | 27 cat_filter.AddDisabledByDefault('disabled-by-default-blink.debug.layout') |
| 27 cat_filter.AddIncludedCategory('devtools.timeline') | 28 cat_filter.AddIncludedCategory('devtools.timeline') |
| 28 | 29 |
| 29 tbm_options = timeline_based_measurement.Options( | 30 tbm_options = timeline_based_measurement.Options( |
| 30 overhead_level=cat_filter) | 31 overhead_level=cat_filter) |
| 31 tbm_options.SetTimelineBasedMetric('firstPaintMetric') | 32 tbm_options.SetTimelineBasedMetric('firstPaintMetric') |
| 32 return tbm_options | 33 return tbm_options |
| 33 | 34 |
| 34 # crbug.com/619254 | 35 @classmethod |
| 35 @benchmark.Disabled('reference') | 36 def ShouldDisable(cls, possible_browser): |
| 37 # crbug.com/616781 | |
| 38 if (cls.IsSvelte(possible_browser) or | |
| 39 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X' or | |
| 40 possible_browser.platform.GetDeviceTypeName() == 'AOSP on BullHead'): | |
| 41 return True | |
| 42 return False | |
| 43 | |
|
nednguyen
2016/06/27 04:33:48
Same here
kouhei (in TOK)
2016/06/27 04:37:01
Done.
| |
| 36 class PageCyclerV2Typical25(_PageCyclerV2): | 44 class PageCyclerV2Typical25(_PageCyclerV2): |
| 37 """Page load time benchmark for a 25 typical web pages. | 45 """Page load time benchmark for a 25 typical web pages. |
| 38 | 46 |
| 39 Designed to represent typical, not highly optimized or highly popular web | 47 Designed to represent typical, not highly optimized or highly popular web |
| 40 sites. Runs against pages recorded in June, 2014. | 48 sites. Runs against pages recorded in June, 2014. |
| 41 """ | 49 """ |
| 42 options = {'pageset_repeat': 2} | 50 options = {'pageset_repeat': 2} |
| 43 | 51 |
| 44 @classmethod | 52 @classmethod |
| 45 def Name(cls): | 53 def Name(cls): |
| 46 return 'page_cycler_v2.typical_25' | 54 return 'page_cycler_v2.typical_25' |
| 47 | 55 |
| 48 @classmethod | |
| 49 def ShouldDisable(cls, possible_browser): | |
| 50 # crbug.com/616781 | |
| 51 if (cls.IsSvelte(possible_browser) or | |
| 52 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X' or | |
| 53 possible_browser.platform.GetDeviceTypeName() == 'AOSP on BullHead'): | |
| 54 return True | |
| 55 return False | |
| 56 | |
| 57 def CreateStorySet(self, options): | 56 def CreateStorySet(self, options): |
| 58 return page_sets.Typical25PageSet(run_no_page_interactions=True, | 57 return page_sets.Typical25PageSet(run_no_page_interactions=True, |
| 59 cache_temperatures=[ | 58 cache_temperatures=[ |
| 60 cache_temperature.PCV1_COLD, cache_temperature.PCV1_WARM]) | 59 cache_temperature.PCV1_COLD, cache_temperature.PCV1_WARM]) |
| 60 | |
|
nednguyen
2016/06/27 04:33:48
ditto
kouhei (in TOK)
2016/06/27 04:37:01
Done.
| |
| 61 class PageCyclerIntlJaZh(_PageCyclerV2): | |
|
nednguyen
2016/06/27 04:33:48
You will want to make sure that this is named Page
kouhei (in TOK)
2016/06/27 04:37:01
Done.
| |
| 62 """Page load time benchmark for a variety of pages in Japanese and Chinese. | |
| 63 | |
| 64 Runs against pages recorded in April, 2013. | |
| 65 """ | |
| 66 page_set = page_sets.IntlJaZhPageSet | |
| 67 | |
| 68 @classmethod | |
| 69 def Name(cls): | |
| 70 return 'page_cycler_v2.intl_ja_zh' | |
| 71 | |
| 72 def CreateStorySet(self, options): | |
| 73 return page_sets.IntlJaZhPageSet(cache_temperatures=[ | |
| 74 cache_temperature.PCV1_COLD, cache_temperature.PCV1_WARM]) | |
| OLD | NEW |