Class: BenchmarkDriver::Runner::Recorded

Inherits:
Object
  • Object
show all
Defined in:
lib/benchmark_driver/runner/recorded.rb

Overview

Run only once, for testing

Defined Under Namespace

Classes: JobParser=Module.new

Constant Summary collapse

Job =

JobParser returns this, BenchmarkDriver::Runner.runner_for searches “*::Job”

::BenchmarkDriver::Struct.new(
  :name,              # @param [String] name - This is mandatory for all runner
  :job,               # @param [BenchmarkDriver::Runner::*::Job]
  :warmup_metrics,    # @param [Hash]
  :benchmark_metrics, # @param [Hash]
  :metrics_type,      # @param [BenchmarkDriver::Metrics::Type]
)

Instance Method Summary collapse

Constructor Details

#initialize(config:, output:) ⇒ Recorded

Returns a new instance of Recorded.

Parameters:



35
36
37
38
# File 'lib/benchmark_driver/runner/recorded.rb', line 35

def initialize(config:, output:)
  @config = config
  @output = output
end

Instance Method Details

#run(records) ⇒ Object

This method is dynamically called by BenchmarkDriver::JobRunner.run

Parameters:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/benchmark_driver/runner/recorded.rb', line 42

def run(records)
  @output.metrics_type = records.first.metrics_type

  records.each do |record|
    unless record.warmup_metrics.empty?
      # TODO:
    end
  end

  @output.with_benchmark do
    records.each do |record|
      @output.with_job(record.job) do
        record.benchmark_metrics.each do |metrics|
          @output.report(metrics)
        end
      end
    end
  end
end