| OLD | NEW |
| (Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 from benchmarks import loading |
| 5 |
| 6 from contrib.cluster_telemetry import ct_benchmarks_util |
| 7 from contrib.cluster_telemetry import page_set |
| 8 |
| 9 from telemetry.page import traffic_setting |
| 10 |
| 11 |
| 12 # pylint: disable=protected-access |
| 13 class LoadingClusterTelemetry(loading._LoadingBase): |
| 14 |
| 15 options = {'upload_results': True} |
| 16 |
| 17 _ALL_NET_CONFIGS = traffic_setting.NETWORK_CONFIGS.keys() |
| 18 |
| 19 @classmethod |
| 20 def AddBenchmarkCommandLineArgs(cls, parser): |
| 21 super(LoadingClusterTelemetry, cls).AddBenchmarkCommandLineArgs(parser) |
| 22 ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser) |
| 23 parser.add_option( |
| 24 '--wait-time', action='store', type='int', |
| 25 default=60, help='Number of seconds to wait for after navigation.') |
| 26 parser.add_option( |
| 27 '--traffic-setting', choices=cls._ALL_NET_CONFIGS, |
| 28 default=traffic_setting.REGULAR_4G, |
| 29 help='Traffic condition (string). Default to "%%default". Can be: %s' % |
| 30 ', '.join(cls._ALL_NET_CONFIGS)) |
| 31 |
| 32 def CreateStorySet(self, options): |
| 33 def Wait(action_runner): |
| 34 action_runner.Wait(options.wait_time) |
| 35 return page_set.CTPageSet( |
| 36 options.urls_list, options.user_agent, options.archive_data_file, |
| 37 traffic_setting=options.traffic_setting, |
| 38 run_page_interaction_callback=Wait) |
| 39 |
| 40 @classmethod |
| 41 def Name(cls): |
| 42 return 'loading.cluster_telemetry' |
| OLD | NEW |