Class: Benchmark::IPS::Job::StreamReport
- Inherits:
-
Object
- Object
- Benchmark::IPS::Job::StreamReport
- Defined in:
- lib/benchmark/ips/job/stream_report.rb
Instance Method Summary collapse
- #add_report(item, caller) ⇒ Object
- #footer ⇒ Object
-
#initialize(stream = $stdout) ⇒ StreamReport
constructor
A new instance of StreamReport.
- #start_running ⇒ Object
- #start_warming ⇒ Object
- #warming(label, _warmup) ⇒ Object (also: #running)
- #warmup_stats(_warmup_time_us, timing) ⇒ Object
Constructor Details
#initialize(stream = $stdout) ⇒ StreamReport
Returns a new instance of StreamReport.
5 6 7 8 |
# File 'lib/benchmark/ips/job/stream_report.rb', line 5 def initialize(stream = $stdout) @last_item = nil @out = stream end |
Instance Method Details
#add_report(item, caller) ⇒ Object
34 35 36 37 |
# File 'lib/benchmark/ips/job/stream_report.rb', line 34 def add_report(item, caller) @out.puts " #{item.body}" @last_item = item end |
#footer ⇒ Object
39 40 41 42 43 |
# File 'lib/benchmark/ips/job/stream_report.rb', line 39 def return unless @last_item = @last_item.stats. @out.puts .rjust(40) if end |
#start_running ⇒ Object
15 16 17 |
# File 'lib/benchmark/ips/job/stream_report.rb', line 15 def start_running @out.puts "Calculating -------------------------------------" end |
#start_warming ⇒ Object
10 11 12 13 |
# File 'lib/benchmark/ips/job/stream_report.rb', line 10 def start_warming @out.puts RUBY_DESCRIPTION @out.puts "Warming up --------------------------------------" end |
#warming(label, _warmup) ⇒ Object Also known as: running
19 20 21 |
# File 'lib/benchmark/ips/job/stream_report.rb', line 19 def warming(label, _warmup) @out.print rjust(label) end |