Sha256: 69f1d450e82757d04b8348d6ab4b9403e724d6a35be94c652836f615a3b1e785
Contents?: true
Size: 1.63 KB
Versions: 3
Compression:
Stored size: 1.63 KB
Contents
module Benchmark module IPS class Job class MultiReport # @returns out [Array<StreamReport>] list of reports to send output attr_accessor :out def empty? @out.empty? end def quiet? @out.none? { |rpt| rpt.kind_of?(StreamReport) } end def quiet! @out.delete_if { |rpt| rpt.kind_of?(StreamReport) } end # @param report [StreamReport] report to accept input? def <<(report) if report.kind_of?(MultiReport) self << report.out elsif report.kind_of?(Enumerable) @out += report elsif report @out << report end end # @param out [Array<StreamReport>] list of reports to send output def initialize(out = nil) @out = [] self << out end def start_warming @out.each { |o| o.start_warming if o.respond_to?(:start_warming) } end def warming(label, warmup) @out.each { |o| o.warming(label, warmup) } end def warmup_stats(warmup_time_us, timing) @out.each { |o| o.warmup_stats(warmup_time_us, timing) } end def start_running @out.each { |o| o.start_running if o.respond_to?(:start_running) } end def running(label, warmup) @out.each { |o| o.running(label, warmup) } end def add_report(item, caller) @out.each { |o| o.add_report(item, caller) } end def footer @out.each { |o| o.footer if o.respond_to?(:footer) } end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
benchmark-ips-2.14.0 | lib/benchmark/ips/job/multi_report.rb |
benchmark-ips-2.13.0 | lib/benchmark/ips/job/multi_report.rb |
benchmark-ips-2.12.0 | lib/benchmark/ips/job/multi_report.rb |