Class: Benchmark::IPS::Job::MultiReport
- Inherits:
-
Object
- Object
- Benchmark::IPS::Job::MultiReport
- Defined in:
- lib/benchmark/ips/job/multi_report.rb
Instance Attribute Summary collapse
-
#out ⇒ Object
Returns the value of attribute out.
Instance Method Summary collapse
- #<<(report) ⇒ Object
- #add_report(item, caller) ⇒ Object
- #empty? ⇒ Boolean
- #footer ⇒ Object
-
#initialize(out = nil) ⇒ MultiReport
constructor
A new instance of MultiReport.
- #quiet! ⇒ Object
- #quiet? ⇒ Boolean
- #running(label, warmup) ⇒ Object
- #start_running ⇒ Object
- #start_warming ⇒ Object
- #warming(label, warmup) ⇒ Object
- #warmup_stats(warmup_time_us, timing) ⇒ Object
Constructor Details
#initialize(out = nil) ⇒ MultiReport
Returns a new instance of MultiReport.
32 33 34 35 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 32 def initialize(out = nil) @out = [] self << out end |
Instance Attribute Details
#out ⇒ Object
Returns the value of attribute out.
6 7 8 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 6 def out @out end |
Instance Method Details
#<<(report) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 21 def <<(report) if report.kind_of?(MultiReport) self << report.out elsif report.kind_of?(Enumerable) @out += report elsif report @out << report end end |
#add_report(item, caller) ⇒ Object
57 58 59 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 57 def add_report(item, caller) @out.each { |o| o.add_report(item, caller) } end |
#empty? ⇒ Boolean
8 9 10 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 8 def empty? @out.empty? end |
#footer ⇒ Object
61 62 63 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 61 def @out.each { |o| o. if o.respond_to?(:footer) } end |
#quiet! ⇒ Object
16 17 18 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 16 def quiet! @out.delete_if { |rpt| rpt.kind_of?(StreamReport) } end |
#quiet? ⇒ Boolean
12 13 14 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 12 def quiet? @out.none? { |rpt| rpt.kind_of?(StreamReport) } end |
#running(label, warmup) ⇒ Object
53 54 55 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 53 def running(label, warmup) @out.each { |o| o.running(label, warmup) } end |
#start_running ⇒ Object
49 50 51 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 49 def start_running @out.each { |o| o.start_running if o.respond_to?(:start_running) } end |
#start_warming ⇒ Object
37 38 39 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 37 def start_warming @out.each { |o| o.start_warming if o.respond_to?(:start_warming) } end |
#warming(label, warmup) ⇒ Object
41 42 43 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 41 def warming(label, warmup) @out.each { |o| o.warming(label, warmup) } end |
#warmup_stats(warmup_time_us, timing) ⇒ Object
45 46 47 |
# File 'lib/benchmark/ips/job/multi_report.rb', line 45 def warmup_stats(warmup_time_us, timing) @out.each { |o| o.warmup_stats(warmup_time_us, timing) } end |