class Benchmark::IPS::Job::StdoutReport
Public Class Methods
Source
# File lib/benchmark/ips/job/stdout_report.rb, line 5 def initialize @last_item = nil end
Public Instance Methods
Source
# File lib/benchmark/ips/job/stdout_report.rb, line 32 def add_report(item, caller) $stdout.puts " #{item.body}" @last_item = item end
Source
# File lib/benchmark/ips/job/stdout_report.rb, line 13 def start_running $stdout.puts "Calculating -------------------------------------" end
Source
# File lib/benchmark/ips/job/stdout_report.rb, line 9 def start_warming $stdout.puts "Warming up --------------------------------------" end
Source
# File lib/benchmark/ips/job/stdout_report.rb, line 17 def warming(label, _warmup) $stdout.print rjust(label) end
Also aliased as: running
Source
# File lib/benchmark/ips/job/stdout_report.rb, line 21 def warmup_stats(_warmup_time_us, timing) case format when :human $stdout.printf "%s i/100ms\n", Helpers.scale(timing) else $stdout.printf "%10d i/100ms\n", timing end end
Private Instance Methods
Source
# File lib/benchmark/ips/job/stdout_report.rb, line 46 def format Benchmark::IPS.options[:format] end
@return [Symbol] format used for benchmarking
Source
# File lib/benchmark/ips/job/stdout_report.rb, line 53 def rjust(label) label = label.to_s if label.size > 20 "#{label}\n#{' ' * 20}" else label.rjust(20) end end
Add padding to label’s right if label’s length < 20, Otherwise add a new line and 20 whitespaces. @return [String] Right justified label.