Class: Bench::Commands::Detail
- Defined in:
- lib/bench9000/commands/detail.rb
Instance Method Summary collapse
- #after(options, measurements) ⇒ Object
- #benchmark_complete(options, b, measurements) ⇒ Object
- #result(options, b, i, measurement) ⇒ Object
Methods inherited from Command
Instance Method Details
#after(options, measurements) ⇒ Object
42 43 44 45 46 |
# File 'lib/bench9000/commands/detail.rb', line 42 def after(, measurements) if .flags.has_key? "--json" puts JSONFormatter.format(, measurements) end end |
#benchmark_complete(options, b, measurements) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/bench9000/commands/detail.rb', line 28 def benchmark_complete(, b, measurements) if .flags.has_key? "--benchmark-per-line" puts "#{b} " + .implementations.map { |i| measurement = measurements[b, i] if measurement == :failed "failed" else "#{measurement.warmup_time} #{measurement.sample_mean} #{measurement.score}" end }.join(" ") end end |
#result(options, b, i, measurement) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/bench9000/commands/detail.rb', line 16 def result(, b, i, measurement) if .flags.has_key? "--value-per-line" if measurement == :failed puts "#{b} #{i} failed" else puts "#{b} #{i} warmup #{measurement.warmup_time}" puts "#{b} #{i} sample #{measurement.sample_mean}" puts "#{b} #{i} score #{measurement.score}" end end end |