diff options
author | Luis Lozano <llozano@chromium.org> | 2013-03-15 14:44:13 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-03-15 15:51:37 -0700 |
commit | f81680c018729fd4499e1e200d04b48c4b90127c (patch) | |
tree | 940608da8374604b82edfdb2d7df55d065f05d4c /crb/autotest_gatherer.py | |
parent | 2296ee0b914aba5bba07becab4ff68884ce9b8a5 (diff) | |
download | toolchain-utils-f81680c018729fd4499e1e200d04b48c4b90127c.tar.gz |
Cleaned up directory after copy of tools from perforce directory
Got rid of stale copies of some tools like "crosperf" and moved all
files under v14 directory (that came from perforce) into the top
directory.
BUG=None
TEST=None
Change-Id: I408d17a36ceb00e74db71403d2351fd466a14f8e
Reviewed-on: https://gerrit-int.chromium.org/33887
Tested-by: Luis Lozano <llozano@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@google.com>
Commit-Queue: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'crb/autotest_gatherer.py')
-rw-r--r-- | crb/autotest_gatherer.py | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/crb/autotest_gatherer.py b/crb/autotest_gatherer.py new file mode 100644 index 00000000..da39040d --- /dev/null +++ b/crb/autotest_gatherer.py @@ -0,0 +1,63 @@ +from table_formatter import TableFormatter as TableFormatter + +class AutotestGatherer(TableFormatter): + def __init__(self): + self.runs = [] + TableFormatter.__init__(self) + + def GetFormattedMainTable(self, percents_only, fit_string): + ret = "" + table = self.GetTableValues() + ret += self.GetTableLabels(table) + ret += self.GetFormattedTable(table, percents_only=percents_only, + fit_string=fit_string) + return ret + + def GetFormattedSummaryTable(self, percents_only, fit_string): + ret = "" + table = self.GetTableValues() + summary_table = self.GetSummaryTableValues(table) + ret += self.GetTableLabels(summary_table) + ret += self.GetFormattedTable(summary_table, percents_only=percents_only, + fit_string=fit_string) + return ret + + def GetBenchmarksString(self): + ret = "Benchmarks (in order):" + ret = "\n".join(self.GetAllBenchmarks()) + return ret + + def GetAllBenchmarks(self): + all_benchmarks = [] + for run in self.runs: + for key in run.results.keys(): + if key not in all_benchmarks: + all_benchmarks.append(key) + all_benchmarks.sort() + return all_benchmarks + + def GetTableValues(self): + table = [] + row = [] + + row.append("Benchmark") + for i in range(len(self.runs)): + run = self.runs[i] + label = run.GetLabel() + label = self.GetLabelWithIteration(label, run.iteration) + row.append(label) + table.append(row) + + all_benchmarks = self.GetAllBenchmarks() + for benchmark in all_benchmarks: + row = [] + row.append(benchmark) + for run in self.runs: + results = run.results + if benchmark in results: + row.append(results[benchmark]) + else: + row.append("") + table.append(row) + + return table |