class Benchmark::Job
Public Instance Methods
item(label = '', &blk)
click to toggle source
# File lib/benchmark/lab.rb, line 33 def item(label = '', &blk) old_item(label, &blk) @list.last << Sample.new @list.last << [] self end
observe_and_summarize(sample_size)
click to toggle source
# File lib/benchmark/lab.rb, line 40 def observe_and_summarize(sample_size) @list.each do |label, item, sample, stats| sample_size.times.each do sample << Benchmark.measure(label, &item) end Experiment::MEASURED_TIMES.keys.each do |time_name| stats << Benchmark::Experiment::DescriptiveStatistics.new(sample.map(&time_name), time_name) end end end