class Benchmark::IPS::Job::StreamReport
def add_report(item, caller)
def add_report(item, caller) @out.puts " #{item.body}" @last_item = item end
def footer
def footer return unless @last_item footer = @last_item.stats.footer @out.puts footer.rjust(40) if footer end
def format
-
(Symbol)
- format used for benchmarking
def format Benchmark::IPS.options[:format] end
def initialize(stream = $stdout)
def initialize(stream = $stdout) @last_item = nil @out = stream end
def rjust(label)
-
(String)
- Right justified label.
def rjust(label) label = label.to_s if label.size > 20 "#{label}\n#{' ' * 20}" else label.rjust(20) end end
def start_running
def start_running @out.puts "Calculating -------------------------------------" end
def start_warming
def start_warming @out.puts RUBY_DESCRIPTION @out.puts "Warming up --------------------------------------" end
def warming(label, _warmup)
def warming(label, _warmup) @out.print rjust(label) end
def warmup_stats(_warmup_time_us, timing)
def warmup_stats(_warmup_time_us, timing) case format when :human @out.printf "%s i/100ms\n", Helpers.scale(timing) else @out.printf "%10d i/100ms\n", timing end end