OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2012 The Chromium Authors. All rights reserved. | 2 # Copyright 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 import time | 8 import time |
9 | 9 |
10 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) | |
11 | |
12 from telemetry.core import browser_finder | 10 from telemetry.core import browser_finder |
13 from telemetry.core import browser_options | 11 from telemetry.core import browser_options |
14 | 12 |
13 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) | |
chrishenry
2014/08/07 23:13:37
What is this code doing?
The entire examples/ dir
nednguyen
2014/08/08 01:13:26
import the environment of telemetry. I will revert
| |
14 | |
15 | |
15 | 16 |
16 def Main(args): | 17 def Main(args): |
17 options = browser_options.BrowserFinderOptions() | 18 options = browser_options.BrowserFinderOptions() |
18 parser = options.CreateParser('telemetry_perf_test.py') | 19 parser = options.CreateParser('telemetry_perf_test.py') |
19 options, args = parser.parse_args(args) | 20 options, args = parser.parse_args(args) |
20 | 21 |
21 browser_to_create = browser_finder.FindBrowser(options) | 22 browser_to_create = browser_finder.FindBrowser(options) |
22 assert browser_to_create | 23 assert browser_to_create |
23 with browser_to_create.Create() as b: | 24 with browser_to_create.Create() as b: |
24 tab = b.tabs[0] | 25 tab = b.tabs[0] |
(...skipping 13 matching lines...) Expand all Loading... | |
38 | 39 |
39 print "%s: avg=%f; stdev=%f; min=%f; 75th percentile = %f" % ( | 40 print "%s: avg=%f; stdev=%f; min=%f; 75th percentile = %f" % ( |
40 "Round trip time (seconds)", | 41 "Round trip time (seconds)", |
41 avg, stdev, min(times), percentile_75) | 42 avg, stdev, min(times), percentile_75) |
42 | 43 |
43 return 0 | 44 return 0 |
44 | 45 |
45 | 46 |
46 if __name__ == '__main__': | 47 if __name__ == '__main__': |
47 sys.exit(Main(sys.argv[1:])) | 48 sys.exit(Main(sys.argv[1:])) |
OLD | NEW |