OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 """Runner for Mojo application benchmarks.""" | 6 """Runner for Mojo application benchmarks.""" |
7 | 7 |
8 import argparse | 8 import argparse |
9 import logging | 9 import logging |
10 import os.path | 10 import os.path |
11 import re | 11 import re |
12 import sys | 12 import sys |
13 import time | 13 import time |
14 | 14 |
15 from devtoolslib import shell_arguments | 15 from devtoolslib import shell_arguments |
16 from devtoolslib import shell_config | 16 from devtoolslib import shell_config |
17 from devtoolslib import perf_dashboard | 17 from devtoolslib import perf_dashboard |
18 | 18 |
19 | 19 |
20 _DESCRIPTION = """Runner for Mojo application benchmarks. | 20 _DESCRIPTION = """Runner for Mojo application benchmarks. |
21 | 21 |
22 |benchmark_list_file| has to be a valid Python program that sets a |benchmarks| | 22 |benchmark_list_file| has to be a valid Python program that sets a |benchmarks| |
23 global variable, containing entries of the following form: | 23 dictionary. For description of the required format see |
24 | 24 https://github.com/domokit/devtools/blob/master/docs/mojo_benchmark.md . |
25 { | |
26 'name': '<name of the benchmark>', | |
27 'app': '<url of the app to benchmark>', | |
28 'shell-args': [], | |
29 'duration': <duration in seconds>, | |
30 | |
31 # List of measurements to make. | |
32 'measurements': [ | |
33 { | |
34 'name': my_measurement, | |
35 'spec': spec, | |
36 }, | |
37 (...) | |
38 ] | |
39 } | |
40 | |
41 For each measurement, 'name' is a label used for presentation purposes. 'spec' | |
42 defines the measurement. | |
43 | |
44 Available measurement types are: | |
45 | |
46 'time_until' - time until the first occurence of the targeted event. The spec | |
47 takes the following format: | |
48 | |
49 'time_until/category/event' | |
50 | |
51 'avg_duration' - average duration of the targeted event. The spec takes the | |
52 following format: | |
53 | |
54 'avg_duration/category/event' | |
55 | |
56 'percentile_duration' - value at the given percentile of the targeted event. The | |
57 spec takes the following format: | |
58 | |
59 'percentile_duration/category/event/percentile' | |
60 | |
61 |benchmark_list_file| may reference the |target_os| global that will be any of | |
62 ['android', 'linux'], indicating the system on which the benchmarks are to be | |
63 run. | |
64 """ | 25 """ |
65 | 26 |
66 _logger = logging.getLogger() | 27 _logger = logging.getLogger() |
67 | 28 |
68 _BENCHMARK_APP = 'https://core.mojoapps.io/benchmark.mojo' | 29 _BENCHMARK_APP = 'https://core.mojoapps.io/benchmark.mojo' |
69 _CACHE_SERVICE_URL = 'mojo:url_response_disk_cache' | 30 _CACHE_SERVICE_URL = 'mojo:url_response_disk_cache' |
70 _NETWORK_SERVICE_URL = 'mojo:network_service' | 31 _NETWORK_SERVICE_URL = 'mojo:network_service' |
71 | 32 |
72 _COLD_START_SHELL_ARGS = [ | 33 _COLD_START_SHELL_ARGS = [ |
73 '--args-for=%s %s' % (_CACHE_SERVICE_URL, '--clear'), | 34 '--args-for=%s %s' % (_CACHE_SERVICE_URL, '--clear'), |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 perf_dashboard.upload_chart_data( | 231 perf_dashboard.upload_chart_data( |
271 script_args.master_name, script_args.bot_name, | 232 script_args.master_name, script_args.bot_name, |
272 script_args.test_name, script_args.builder_name, | 233 script_args.test_name, script_args.builder_name, |
273 script_args.build_number, chart_data_recorder.get_chart_data(), | 234 script_args.build_number, chart_data_recorder.get_chart_data(), |
274 script_args.server_url, script_args.dry_run) | 235 script_args.server_url, script_args.dry_run) |
275 | 236 |
276 return exit_code | 237 return exit_code |
277 | 238 |
278 if __name__ == '__main__': | 239 if __name__ == '__main__': |
279 sys.exit(main()) | 240 sys.exit(main()) |
OLD | NEW |