Class: Benchmark::IPS::Job::StdoutReport
- Inherits:
-
Object
- Object
- Benchmark::IPS::Job::StdoutReport
- Defined in:
- lib/benchmark/ips/job/stdout_report.rb
Instance Method Summary collapse
- #add_report(item, caller) ⇒ Object
- #footer ⇒ Object
-
#initialize ⇒ StdoutReport
constructor
A new instance of StdoutReport.
- #start_running ⇒ Object
- #start_warming ⇒ Object
- #warming(label, _warmup) ⇒ Object (also: #running)
- #warmup_stats(_warmup_time_us, timing) ⇒ Object
Constructor Details
#initialize ⇒ StdoutReport
Returns a new instance of StdoutReport.
5 6 7 |
# File 'lib/benchmark/ips/job/stdout_report.rb', line 5 def initialize @last_item = nil end |
Instance Method Details
#add_report(item, caller) ⇒ Object
32 33 34 35 |
# File 'lib/benchmark/ips/job/stdout_report.rb', line 32 def add_report(item, caller) $stdout.puts " #{item.body}" @last_item = item end |
#footer ⇒ Object
37 38 39 40 41 |
# File 'lib/benchmark/ips/job/stdout_report.rb', line 37 def return unless @last_item = @last_item.stats. $stdout.puts .rjust(40) if end |
#start_running ⇒ Object
13 14 15 |
# File 'lib/benchmark/ips/job/stdout_report.rb', line 13 def start_running $stdout.puts "Calculating -------------------------------------" end |
#start_warming ⇒ Object
9 10 11 |
# File 'lib/benchmark/ips/job/stdout_report.rb', line 9 def start_warming $stdout.puts "Warming up --------------------------------------" end |
#warming(label, _warmup) ⇒ Object Also known as: running
17 18 19 |
# File 'lib/benchmark/ips/job/stdout_report.rb', line 17 def warming(label, _warmup) $stdout.print rjust(label) end |
#warmup_stats(_warmup_time_us, timing) ⇒ Object
21 22 23 24 25 26 27 28 |
# 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 |