lib/benchmark_driver/runner/time.rb in benchmark_driver-0.10.16 vs lib/benchmark_driver/runner/time.rb in benchmark_driver-0.11.0

- old
+ new

@@ -4,20 +4,17 @@ # 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) - METRICS_TYPE = BenchmarkDriver::Metrics::Type.new(unit: 's', larger_better: false) + METRIC = BenchmarkDriver::Metric.new(name: 'Execution time', unit: 's', larger_better: false) - # Overriding BenchmarkDriver::Runner::Ips#set_metrics_type - def set_metrics_type - @output.metrics_type = METRICS_TYPE + # Overriding BenchmarkDriver::Runner::Ips#metric + def metric + METRIC end - # Overriding BenchmarkDriver::Runner::Ips#build_metrics - def build_metrics(duration:, executable:, loop_count:) - BenchmarkDriver::Metrics.new( - value: duration, - executable: executable, - ) + # Overriding BenchmarkDriver::Runner::Ips#value_duration + def value_duration(duration:, loop_count:) + [duration, duration] end end