| 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 from core import perf_benchmark | 5 from core import perf_benchmark |
| 6 import page_sets | 6 import page_sets |
| 7 | 7 |
| 8 import ct_benchmarks_util | 8 import ct_benchmarks_util |
| 9 from benchmarks import page_cycler_v2 | 9 from benchmarks import page_cycler_v2 |
| 10 from telemetry import benchmark | 10 from telemetry import benchmark |
| 11 from telemetry.page import cache_temperature | 11 from telemetry.page import cache_temperature |
| 12 from telemetry.page import traffic_setting | 12 from telemetry.page import traffic_setting |
| 13 from telemetry.web_perf import timeline_based_measurement |
| 13 | 14 |
| 14 | 15 |
| 15 @benchmark.Enabled('android') | 16 @benchmark.Enabled('android') |
| 16 class LoadingMobile(perf_benchmark.PerfBenchmark): | 17 class LoadingMobile(perf_benchmark.PerfBenchmark): |
| 17 """ A benchmark measuring loading performance of mobile sites. """ | 18 """ A benchmark measuring loading performance of mobile sites. """ |
| 18 | 19 |
| 19 options = {'pageset_repeat': 2} | 20 options = {'pageset_repeat': 2} |
| 20 | 21 |
| 21 def CreateTimelineBasedMeasurementOptions(self): | 22 def CreateTimelineBasedMeasurementOptions(self): |
| 22 return page_cycler_v2.TimelineBasedMeasurementOptionsForLoadingMetric() | 23 tbm_options = timeline_based_measurement.Options() |
| 24 page_cycler_v2.AugmentOptionsForLoadingMetrics(tbm_options) |
| 25 return tbm_options |
| 23 | 26 |
| 24 @classmethod | 27 @classmethod |
| 25 def ShouldDisable(cls, possible_browser): | 28 def ShouldDisable(cls, possible_browser): |
| 26 # crbug.com/619254 | 29 # crbug.com/619254 |
| 27 if possible_browser.browser_type == 'reference': | 30 if possible_browser.browser_type == 'reference': |
| 28 return True | 31 return True |
| 29 | 32 |
| 30 # crbug.com/651188 | 33 # crbug.com/651188 |
| 31 if possible_browser.browser_type == 'android-webview': | 34 if possible_browser.browser_type == 'android-webview': |
| 32 return True | 35 return True |
| (...skipping 13 matching lines...) Expand all Loading... |
| 46 # Disabled because we do not plan on running CT benchmarks on the perf | 49 # Disabled because we do not plan on running CT benchmarks on the perf |
| 47 # waterfall any time soon. | 50 # waterfall any time soon. |
| 48 @benchmark.Disabled('all') | 51 @benchmark.Disabled('all') |
| 49 class LoadingClusterTelemetry(perf_benchmark.PerfBenchmark): | 52 class LoadingClusterTelemetry(perf_benchmark.PerfBenchmark): |
| 50 | 53 |
| 51 options = {'upload_results': True} | 54 options = {'upload_results': True} |
| 52 | 55 |
| 53 _ALL_NET_CONFIGS = traffic_setting.NETWORK_CONFIGS.keys() | 56 _ALL_NET_CONFIGS = traffic_setting.NETWORK_CONFIGS.keys() |
| 54 | 57 |
| 55 def CreateTimelineBasedMeasurementOptions(self): | 58 def CreateTimelineBasedMeasurementOptions(self): |
| 56 return page_cycler_v2.TimelineBasedMeasurementOptionsForLoadingMetric() | 59 tbm_options = timeline_based_measurement.Options() |
| 60 page_cycler_v2.AugmentOptionsForLoadingMetrics(tbm_options) |
| 61 return tbm_options |
| 57 | 62 |
| 58 @classmethod | 63 @classmethod |
| 59 def Name(cls): | 64 def Name(cls): |
| 60 return 'loading.cluster_telemetry' | 65 return 'loading.cluster_telemetry' |
| 61 | 66 |
| 62 @classmethod | 67 @classmethod |
| 63 def AddBenchmarkCommandLineArgs(cls, parser): | 68 def AddBenchmarkCommandLineArgs(cls, parser): |
| 64 super(LoadingClusterTelemetry, cls).AddBenchmarkCommandLineArgs(parser) | 69 super(LoadingClusterTelemetry, cls).AddBenchmarkCommandLineArgs(parser) |
| 65 ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser) | 70 ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser) |
| 66 parser.add_option( | 71 parser.add_option( |
| 67 '--wait-time', action='store', type='int', | 72 '--wait-time', action='store', type='int', |
| 68 default=60, help='Number of seconds to wait for after navigation.') | 73 default=60, help='Number of seconds to wait for after navigation.') |
| 69 parser.add_option( | 74 parser.add_option( |
| 70 '--traffic-setting', choices=cls._ALL_NET_CONFIGS, | 75 '--traffic-setting', choices=cls._ALL_NET_CONFIGS, |
| 71 default=traffic_setting.REGULAR_4G, | 76 default=traffic_setting.REGULAR_4G, |
| 72 help='Traffic condition (string). Default to "%%default". Can be: %s' % | 77 help='Traffic condition (string). Default to "%%default". Can be: %s' % |
| 73 ', '.join(cls._ALL_NET_CONFIGS)) | 78 ', '.join(cls._ALL_NET_CONFIGS)) |
| 74 | 79 |
| 75 def CreateStorySet(self, options): | 80 def CreateStorySet(self, options): |
| 76 def Wait(action_runner): | 81 def Wait(action_runner): |
| 77 action_runner.Wait(options.wait_time) | 82 action_runner.Wait(options.wait_time) |
| 78 return page_sets.CTPageSet( | 83 return page_sets.CTPageSet( |
| 79 options.urls_list, options.user_agent, options.archive_data_file, | 84 options.urls_list, options.user_agent, options.archive_data_file, |
| 80 traffic_setting=options.traffic_setting, | 85 traffic_setting=options.traffic_setting, |
| 81 run_page_interaction_callback=Wait) | 86 run_page_interaction_callback=Wait) |
| OLD | NEW |