Class: Benchmark::IPS::Job::MultiReport

Inherits:
Object
  • Object
show all
Defined in:
lib/benchmark/ips/job/multi_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(out = nil) ⇒ MultiReport

Returns a new instance of MultiReport.

Parameters:

  • out (Array<StreamReport>) (defaults to: nil)

    list of reports to send output



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

#outObject

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

Parameters:



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

Returns:

  • (Boolean)


8
9
10
# File 'lib/benchmark/ips/job/multi_report.rb', line 8

def empty?
  @out.empty?
end


61
62
63
# File 'lib/benchmark/ips/job/multi_report.rb', line 61

def footer
  @out.each { |o| o.footer 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

Returns:

  • (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_runningObject



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_warmingObject



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