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 sys | 10 import sys |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 name.replace(' ', '_'), | 67 name.replace(' ', '_'), |
68 'cold_start' if cold_start else 'warm_start', | 68 'cold_start' if cold_start else 'warm_start', |
69 time.strftime('%Y%m%d%H%M%S')) | 69 time.strftime('%Y%m%d%H%M%S')) |
70 benchmark_args.append('--trace-output=' + trace_output_file) | 70 benchmark_args.append('--trace-output=' + trace_output_file) |
71 | 71 |
72 for measurement in measurements: | 72 for measurement in measurements: |
73 benchmark_args.append(measurement) | 73 benchmark_args.append(measurement) |
74 | 74 |
75 shell_args = list(shell_args) | 75 shell_args = list(shell_args) |
76 shell_args.append(_BENCHMARK_APP) | 76 shell_args.append(_BENCHMARK_APP) |
| 77 shell_args.append('--force-offline-by-default') |
77 shell_args.append('--args-for=%s %s' % (_BENCHMARK_APP, | 78 shell_args.append('--args-for=%s %s' % (_BENCHMARK_APP, |
78 ' '.join(benchmark_args))) | 79 ' '.join(benchmark_args))) |
79 | 80 |
80 if cold_start: | 81 if cold_start: |
81 shell_args.append('--args-for=%s %s' % (_CACHE_SERVICE_URL, '--clear')) | 82 shell_args.append('--args-for=%s %s' % (_CACHE_SERVICE_URL, '--clear')) |
82 shell_args.append('--args-for=%s %s' % (_NETWORK_SERVICE_URL, '--clear')) | 83 shell_args.append('--args-for=%s %s' % (_NETWORK_SERVICE_URL, '--clear')) |
83 | 84 |
84 if verbose: | 85 if verbose: |
85 print 'shell arguments: ' + str(shell_args) | 86 print 'shell arguments: ' + str(shell_args) |
86 print '[ %s ] %s' % (name, 'cold start' if cold_start else 'warm start') | 87 print '[ %s ] %s' % (name, 'cold start' if cold_start else 'warm start') |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 cold_start=True, verbose=script_args.verbose, | 141 cold_start=True, verbose=script_args.verbose, |
141 save_traces=script_args.save_traces) | 142 save_traces=script_args.save_traces) |
142 _run_benchmark(shell, shell_args, name, app, duration, measurements, | 143 _run_benchmark(shell, shell_args, name, app, duration, measurements, |
143 cold_start=False, verbose=script_args.verbose, | 144 cold_start=False, verbose=script_args.verbose, |
144 save_traces=script_args.save_traces) | 145 save_traces=script_args.save_traces) |
145 | 146 |
146 return 0 if succeeded else 1 | 147 return 0 if succeeded else 1 |
147 | 148 |
148 if __name__ == '__main__': | 149 if __name__ == '__main__': |
149 sys.exit(main()) | 150 sys.exit(main()) |
OLD | NEW |