Class: Benchmark::Memory::Job::IOOutput
- Inherits:
-
Object
- Object
- Benchmark::Memory::Job::IOOutput
- Defined in:
- lib/benchmark/memory/job/io_output.rb,
lib/benchmark/memory/job/io_output/entry_formatter.rb,
lib/benchmark/memory/job/io_output/metric_formatter.rb,
lib/benchmark/memory/job/io_output/comparison_formatter.rb
Overview
Output the results of jobs into an IO.
Defined Under Namespace
Classes: ComparisonFormatter, EntryFormatter, MetricFormatter
Instance Method Summary collapse
-
#initialize(io) ⇒ IOOutput
constructor
Instantiate a new output that writes to an IO.
-
#put_comparison(comparison) ⇒ void
Put the comparison onto the output.
-
#put_entry(entry) ⇒ void
Put the entry onto the output.
-
#put_header ⇒ void
Put the header onto the output.
-
#put_hold_notice ⇒ void
Put a notice that the execution is holding for another run.
Constructor Details
#initialize(io) ⇒ IOOutput
Instantiate a new output that writes to an IO.
14 15 16 |
# File 'lib/benchmark/memory/job/io_output.rb', line 14 def initialize(io) @io = io end |
Instance Method Details
#put_comparison(comparison) ⇒ void
This method returns an undefined value.
Put the comparison onto the output.
28 29 30 31 32 |
# File 'lib/benchmark/memory/job/io_output.rb', line 28 def put_comparison(comparison) @io.puts @io.puts 'Comparison:' @io.puts ComparisonFormatter.new(comparison) end |
#put_entry(entry) ⇒ void
This method returns an undefined value.
Put the entry onto the output.
21 22 23 |
# File 'lib/benchmark/memory/job/io_output.rb', line 21 def put_entry(entry) @io.puts EntryFormatter.new(entry) end |
#put_header ⇒ void
This method returns an undefined value.
Put the header onto the output.
37 38 39 |
# File 'lib/benchmark/memory/job/io_output.rb', line 37 def put_header @io.puts 'Calculating -------------------------------------' end |
#put_hold_notice ⇒ void
This method returns an undefined value.
Put a notice that the execution is holding for another run.
44 45 46 47 48 |
# File 'lib/benchmark/memory/job/io_output.rb', line 44 def put_hold_notice @io.puts @io.puts 'Pausing here -- run Ruby again to ' \ 'measure the next benchmark...' end |