OLD | NEW |
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 chrome_remote_control import browser_finder | 10 from chrome_remote_control import browser_finder |
11 from chrome_remote_control import browser_options | 11 from chrome_remote_control import browser_options |
12 from chrome_remote_control import multi_page_benchmark | 12 from chrome_remote_control import multi_page_benchmark |
13 from chrome_remote_control import page_runner | 13 from chrome_remote_control import page_runner |
14 from chrome_remote_control import page_set | 14 from chrome_remote_control import page_set |
15 | 15 |
16 import perf_tools.first_paint_time_benchmark | 16 import perf_tools.first_paint_time_benchmark |
17 import perf_tools.jsgamebench | 17 import perf_tools.jsgamebench |
18 import perf_tools.kraken | 18 import perf_tools.kraken |
| 19 import perf_tools.memory_benchmark |
19 import perf_tools.robohornetpro | 20 import perf_tools.robohornetpro |
20 import perf_tools.scrolling_benchmark | 21 import perf_tools.scrolling_benchmark |
21 import perf_tools.skpicture_printer | 22 import perf_tools.skpicture_printer |
22 import perf_tools.texture_upload_benchmark | 23 import perf_tools.texture_upload_benchmark |
23 | 24 |
24 # TODO(tonyg/nduca): Discover benchmarks automagically. | 25 # TODO(tonyg/nduca): Discover benchmarks automagically. |
25 _BENCHMARKS = { | 26 _BENCHMARKS = { |
26 'first_paint_time_benchmark': | 27 'first_paint_time_benchmark': |
27 perf_tools.first_paint_time_benchmark.FirstPaintTimeBenchmark, | 28 perf_tools.first_paint_time_benchmark.FirstPaintTimeBenchmark, |
28 'jsgamebench': | 29 'jsgamebench': |
29 perf_tools.jsgamebench.JsGameBench, | 30 perf_tools.jsgamebench.JsGameBench, |
30 'kraken': | 31 'kraken': |
31 perf_tools.kraken.Kraken, | 32 perf_tools.kraken.Kraken, |
| 33 'memory_benchmark': |
| 34 perf_tools.memory_benchmark.MemoryBenchmark, |
32 'robohornetpro': | 35 'robohornetpro': |
33 perf_tools.robohornetpro.RobohornetPro, | 36 perf_tools.robohornetpro.RobohornetPro, |
34 'scrolling_benchmark': | 37 'scrolling_benchmark': |
35 perf_tools.scrolling_benchmark.ScrollingBenchmark, | 38 perf_tools.scrolling_benchmark.ScrollingBenchmark, |
36 'skpicture_printer': | 39 'skpicture_printer': |
37 perf_tools.skpicture_printer.SkPicturePrinter, | 40 perf_tools.skpicture_printer.SkPicturePrinter, |
38 'texture_upload_benchmark': | 41 'texture_upload_benchmark': |
39 perf_tools.texture_upload_benchmark.TextureUploadBenchmark | 42 perf_tools.texture_upload_benchmark.TextureUploadBenchmark |
40 } | 43 } |
41 | 44 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 with page_runner.PageRunner(ps) as runner: | 88 with page_runner.PageRunner(ps) as runner: |
86 runner.Run(options, possible_browser, benchmark, results) | 89 runner.Run(options, possible_browser, benchmark, results) |
87 # When using an exact executable, assume it is a reference build for the | 90 # When using an exact executable, assume it is a reference build for the |
88 # purpose of outputting the perf results. | 91 # purpose of outputting the perf results. |
89 results.PrintSummary(options.browser_executable and '_ref' or '') | 92 results.PrintSummary(options.browser_executable and '_ref' or '') |
90 | 93 |
91 if len(results.page_failures): | 94 if len(results.page_failures): |
92 logging.warning('Failed pages: %s', '\n'.join( | 95 logging.warning('Failed pages: %s', '\n'.join( |
93 [failure['page'].url for failure in results.page_failures])) | 96 [failure['page'].url for failure in results.page_failures])) |
94 return min(255, len(results.page_failures)) | 97 return min(255, len(results.page_failures)) |
OLD | NEW |