lib/benchmark_driver/runner/once.rb in benchmark_driver-0.9.2 vs lib/benchmark_driver/runner/once.rb in benchmark_driver-0.10.0

- old
+ new

@@ -9,22 +9,24 @@ class BenchmarkDriver::Runner::Once # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job" Job = Class.new(BenchmarkDriver::DefaultJob) # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse` JobParser = BenchmarkDriver::DefaultJobParser.for(Job) - # Passed to `output` by `BenchmarkDriver::Runner.run` - MetricsType = BenchmarkDriver::Metrics::Type.new(unit: 'i/s') + METRICS_TYPE = BenchmarkDriver::Metrics::Type.new(unit: 'i/s') + # @param [BenchmarkDriver::Config::RunnerConfig] config # @param [BenchmarkDriver::Output::*] output def initialize(config:, output:) @config = config @output = output end # This method is dynamically called by `BenchmarkDriver::JobRunner.run` # @param [Array<BenchmarkDriver::Default::Job>] jobs def run(jobs) + @output.metrics_type = METRICS_TYPE + jobs = jobs.map do |job| Job.new(job.to_h.merge(loop_count: 1)) # to show this on output end @output.with_benchmark do