From 06cc11993112486b5bcb926e31b9c657465be614 Mon Sep 17 00:00:00 2001 From: "tonyg@chromium.org" Date: Tue, 12 Feb 2013 01:44:09 +0000 Subject: [Telemetry] Add an --extra-wpr-args flag. This is useful for running telemetry under simulated bandwidth conditions. For example, to run with DSL speed, pass: --extra-wpr-args="--shaping_type=proxy --net=dsl" BUG=None TEST=tools/perf/run_multipage_benchmarks --extra-wpr-args="--shaping_type=proxy --net=dsl" --browser=system loading_benchmark tools/perf/page_sets/top_25.json NOTRY=True Review URL: https://codereview.chromium.org/12224111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181815 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/telemetry/telemetry/browser_options.py | 10 ++++++++++ tools/telemetry/telemetry/wpr_server.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/telemetry/telemetry/browser_options.py b/tools/telemetry/telemetry/browser_options.py index a174e13..631499c 100644 --- a/tools/telemetry/telemetry/browser_options.py +++ b/tools/telemetry/telemetry/browser_options.py @@ -24,6 +24,7 @@ class BrowserOptions(optparse.Values): self.dont_override_profile = False self.extra_browser_args = [] + self.extra_wpr_args = [] self.show_stdout = False self.cros_remote = None @@ -86,6 +87,10 @@ class BrowserOptions(optparse.Values): group.add_option('--extra-browser-args', dest='extra_browser_args_as_string', help='Additional arguments to pass to the browser when it starts') + group.add_option('--extra-wpr-args', + dest='extra_wpr_args_as_string', + help=('Additional arguments to pass to Web Page Replay. ' + 'See third_party/webpagereplay/replay.py for usage.')) group.add_option('--show-stdout', action='store_true', help='When possible, will display the stdout of the process') @@ -151,6 +156,11 @@ class BrowserOptions(optparse.Values): self.extra_browser_args_as_string) # pylint: disable=E1101 self.extra_browser_args.extend(tmp) delattr(self, 'extra_browser_args_as_string') + if self.extra_wpr_args_as_string: # pylint: disable=E1101 + tmp = shlex.split( + self.extra_wpr_args_as_string) # pylint: disable=E1101 + self.extra_wpr_args.extend(tmp) + delattr(self, 'extra_wpr_args_as_string') return ret parser.parse_args = ParseArgs return parser diff --git a/tools/telemetry/telemetry/wpr_server.py b/tools/telemetry/telemetry/wpr_server.py index 3a3bc00..ca155dd 100644 --- a/tools/telemetry/telemetry/wpr_server.py +++ b/tools/telemetry/telemetry/wpr_server.py @@ -37,7 +37,7 @@ class ReplayServer(object): util.PortPair(self._webpagereplay_local_https_port, self._webpagereplay_remote_https_port)) - options = [] + options = browser_backend.options.extra_wpr_args if self._is_record_mode: options.append('--record') if not browser_backend.options.wpr_make_javascript_deterministic: -- cgit v1.1