class BenchmarkHarness::Collection
Constants
- KEYS
order corresponds to values in each sample
- STATS
- STATS_HUMAN
Public Instance Methods
print()
click to toggle source
Formatted output
# File lib/benchmark_harness/collection.rb, line 44 def print label_size = STATS_HUMAN.max{|a, b| a.size <=> b.size}.size puts sprintf("%#{label_size}s %d", "Samples:", self.size) if self.size > 0 puts sprintf("%#{label_size}s: %10s %10s %10s %10s %10s", "Displaying", "user", "system", "ch.user", "ch.system", "real") STATS_HUMAN.each_with_index do |label, i| puts sprintf("%#{label_size}s: %10.4g %10.4g %10.4g %10.4g %10.4g", label, *KEYS.collect{|k| self.send(STATS[i], k)}) end end end
reconciled()
click to toggle source
Sorts values into named vectors:
@example {:user => [1,3,2,3], :system => [0,0,0,1]}
# File lib/benchmark_harness/collection.rb, line 12 def reconciled return @reconciled if @reconciled @reconciled = Hash.new{|h,k| h[k] = []} self.each do |sample| KEYS.each_with_index do |key, index| @reconciled[key] << sample[index] end end @reconciled end