mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
benchmark_driver/runner: add runners for metrics
supported by legacy benchmark/driver.rb. benchmark/README.md: document them common.mk: update benchmark_driver to correct 0.0 output and to fix spacing format of `-o simple` and `-o markdown`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
79a8c10b0b
commit
f328fe40b3
7 changed files with 230 additions and 2 deletions
22
benchmark/lib/benchmark_driver/runner/cutime.rb
Normal file
22
benchmark/lib/benchmark_driver/runner/cutime.rb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
require 'benchmark_driver/runner/total'
|
||||
|
||||
class BenchmarkDriver::Runner::Cutime < BenchmarkDriver::Runner::Total
|
||||
METRIC = BenchmarkDriver::Metric.new(name: 'cutime', unit: 's', larger_better: false)
|
||||
|
||||
# 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(klass: Job, metrics: [METRIC])
|
||||
|
||||
private
|
||||
|
||||
# Overriding BenchmarkDriver::Runner::Total#metric
|
||||
def metric
|
||||
METRIC
|
||||
end
|
||||
|
||||
# Overriding BenchmarkDriver::Runner::Total#target
|
||||
def target
|
||||
:cutime
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue