class Bench::Commands::Detail

Public Instance Methods

after(options, measurements) click to toggle source
# File lib/bench9000/commands/detail.rb, line 42
def after(options, measurements)
  if options.flags.has_key? "--json"
    puts JSONFormatter.format(options, measurements)
  end
end
benchmark_complete(options, b, measurements) click to toggle source
# File lib/bench9000/commands/detail.rb, line 28
def benchmark_complete(options, b, measurements)
  if options.flags.has_key? "--benchmark-per-line"
    puts "#{b} " + options.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) click to toggle source
# File lib/bench9000/commands/detail.rb, line 16
def result(options, b, i, measurement)
  if options.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