class BenchmarkDriver::Runner::Recorded

Run only once, for testing

Constants

Job

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

Public Class Methods

new(config:, output:, contexts:) click to toggle source

@param [BenchmarkDriver::Config::RunnerConfig] config @param [BenchmarkDriver::Output] output @param [BenchmarkDriver::Context] contexts

# File lib/benchmark_driver/runner/recorded.rb, line 36
def initialize(config:, output:, contexts:)
  @config = config
  @output = output
  @contexts = contexts
end

Public Instance Methods

run(records) click to toggle source

This method is dynamically called by `BenchmarkDriver::JobRunner.run` @param [Array<BenchmarkDriver::Runner::Recorded::Job>] record

# File lib/benchmark_driver/runner/recorded.rb, line 44
def run(records)
  records.each do |record|
    unless record.warmup_results.empty?
      # TODO:
    end
  end

  @output.with_benchmark do
    records.each do |record|
      @output.with_job(name: record.name) do
        record.benchmark_results.each do |context, result|
          @output.with_context(
            name: context.name,
            executable: context.executable,
            gems: context.gems,
            prelude: context.prelude,
          ) do
            @output.report(
              values: result.values,
              all_values: result.all_values,
              duration: result.duration,
              loop_count: result.loop_count,
              environment: result.environment,
            )
          end
        end
      end
    end
  end
end