Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: tools/telemetry/telemetry/multi_page_benchmark_runner.py

Issue 11428107: Telemetry: extends Platform abstraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 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 import csv 5 import csv
6 import logging 6 import logging
7 import os 7 import os
8 import sys 8 import sys
9 9
10 from telemetry import all_page_interactions # pylint: disable=W0611 10 from telemetry import all_page_interactions # pylint: disable=W0611
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 ps = page_set.PageSet.FromFile(args[1]) 54 ps = page_set.PageSet.FromFile(args[1])
55 55
56 benchmark.CustomizeBrowserOptions(options) 56 benchmark.CustomizeBrowserOptions(options)
57 possible_browser = browser_finder.FindBrowser(options) 57 possible_browser = browser_finder.FindBrowser(options)
58 if not possible_browser: 58 if not possible_browser:
59 print >> sys.stderr, """No browser found.\n 59 print >> sys.stderr, """No browser found.\n
60 Use --browser=list to figure out which are available.\n""" 60 Use --browser=list to figure out which are available.\n"""
61 sys.exit(1) 61 sys.exit(1)
62 62
63 results = multi_page_benchmark.CsvBenchmarkResults(csv.writer(sys.stdout)) 63 results = multi_page_benchmark.CsvBenchmarkResults(csv.writer(sys.stdout))
64 with page_runner.PageRunner(ps) as runner: 64 with possible_browser.CreatePlatformHarness():
65 runner.Run(options, possible_browser, benchmark, results) 65 with page_runner.PageRunner(ps) as runner:
66 runner.Run(options, possible_browser, benchmark, results)
67
66 # When using an exact executable, assume it is a reference build for the 68 # When using an exact executable, assume it is a reference build for the
67 # purpose of outputting the perf results. 69 # purpose of outputting the perf results.
68 results.PrintSummary(options.browser_executable and '_ref' or '') 70 results.PrintSummary(options.browser_executable and '_ref' or '')
69 71
70 if len(results.page_failures): 72 if len(results.page_failures):
71 logging.warning('Failed pages: %s', '\n'.join( 73 logging.warning('Failed pages: %s', '\n'.join(
72 [failure['page'].url for failure in results.page_failures])) 74 [failure['page'].url for failure in results.page_failures]))
73 75
74 if len(results.skipped_pages): 76 if len(results.skipped_pages):
75 logging.warning('Skipped pages: %s', '\n'.join( 77 logging.warning('Skipped pages: %s', '\n'.join(
76 [skipped['page'].url for skipped in results.skipped_pages])) 78 [skipped['page'].url for skipped in results.skipped_pages]))
77 return min(255, len(results.page_failures)) 79 return min(255, len(results.page_failures))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698