-
Notifications
You must be signed in to change notification settings - Fork 6
/
results_aggregator.rb
executable file
·39 lines (31 loc) · 1.08 KB
/
results_aggregator.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env ruby
INPUT_COLUMNS = {
config_name: "Name of configuration",
level: "Testing level",
bench_name: "Name of benchmark",
user_cpu_time: "Amount of user CPU time",
system_cpu_time: "Amount of system CPU time",
total_cpu_time: "Amount of total CPU time",
elapsed_real_time: "Amount of actual/real/wallclock time",
kb_of_memory_used: "Difference in process memory usage from the benchmark",
transaction_used: "Whether a transaction was used",
}
Row = Struct.new(*INPUT_COLUMNS.keys)
rows = ARGF.read.split("\n").map { |line| Row.new *line.split(",") }
config_names = rows.map(&:config_name).uniq
benchmarks = {}
rows.each do |row|
key = "#{row.bench_name} (#{row.transaction_used})"
b = benchmarks[key] ||= {}
b[row.config_name] = row
end
puts "Benchmark,#{config_names.join(',')}"
benchmarks.sort.each do |bench_name, results|
cells = config_names.map do |config_name|
if row = results[config_name]
row.elapsed_real_time.to_f.round(4)
end
end
cells.unshift(bench_name)
puts cells.join(',')
end