Ahmad Sharif | 0dcbc4b | 2012-02-02 16:37:18 -0800 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
Yunlian Jiang | 04dc5dc | 2013-04-23 15:05:05 -0700 | [diff] [blame] | 3 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
Ahmad Sharif | 0dcbc4b | 2012-02-02 16:37:18 -0800 | [diff] [blame] | 6 | |
| 7 | |
| 8 | class Benchmark(object): |
| 9 | """Class representing a benchmark to be run. |
| 10 | |
Yunlian Jiang | 04dc5dc | 2013-04-23 15:05:05 -0700 | [diff] [blame] | 11 | Contains details of the benchmark suite, arguments to pass to the suite, |
| 12 | iterations to run the benchmark suite and so on. Note that the benchmark name |
| 13 | can be different to the test suite name. For example, you may want to have |
| 14 | two different benchmarks which run the same test_name with different |
Ahmad Sharif | 0dcbc4b | 2012-02-02 16:37:18 -0800 | [diff] [blame] | 15 | arguments. |
| 16 | """ |
| 17 | |
Yunlian Jiang | 04dc5dc | 2013-04-23 15:05:05 -0700 | [diff] [blame] | 18 | def __init__(self, name, test_name, test_args, iterations, |
cmtice | 98a5369 | 2014-04-16 14:48:47 -0700 | [diff] [blame] | 19 | rm_chroot_tmp, perf_args, suite="", |
| 20 | show_all_results=False): |
Ahmad Sharif | 0dcbc4b | 2012-02-02 16:37:18 -0800 | [diff] [blame] | 21 | self.name = name |
Yunlian Jiang | 04dc5dc | 2013-04-23 15:05:05 -0700 | [diff] [blame] | 22 | #For telemetry, this is the benchmark name. |
| 23 | self.test_name = test_name |
| 24 | #For telemetry, this is the data. |
| 25 | self.test_args = test_args |
Ahmad Sharif | 0dcbc4b | 2012-02-02 16:37:18 -0800 | [diff] [blame] | 26 | self.iterations = iterations |
Ahmad Sharif | f395c26 | 2012-10-09 17:48:09 -0700 | [diff] [blame] | 27 | self.perf_args = perf_args |
Luis Lozano | f81680c | 2013-03-15 14:44:13 -0700 | [diff] [blame] | 28 | self.rm_chroot_tmp = rm_chroot_tmp |
Ahmad Sharif | 4467f00 | 2012-12-20 12:09:49 -0800 | [diff] [blame] | 29 | self.iteration_adjusted = False |
Yunlian Jiang | 04dc5dc | 2013-04-23 15:05:05 -0700 | [diff] [blame] | 30 | self.suite = suite |
cmtice | 9847df9 | 2013-12-06 15:46:49 -0800 | [diff] [blame] | 31 | self.show_all_results = show_all_results |
cmtice | 226e3e0 | 2014-04-27 22:28:42 -0700 | [diff] [blame^] | 32 | if self.suite == "telemetry": |
| 33 | self.show_all_results = True |