1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/benchmark/lib/benchmark_driver/runner/size.rb
k0kubun 79a8c10b0b runner/size.rb: fix metric passed to output
runner/peak.rb: ditto

This is needed to make commands like `make -C .ruby-svn benchmark
ITEM=erb OPTS="-r size -o simple"` succeed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-10 14:16:57 +00:00

25 lines
767 B
Ruby

require 'benchmark_driver/runner/peak'
# Actually the same as BenchmarkDriver::Runner::Memory
class BenchmarkDriver::Runner::Size < BenchmarkDriver::Runner::Peak
METRIC = BenchmarkDriver::Metric.new(
name: 'Max resident set size', unit: 'bytes', larger_better: false, worse_word: 'larger',
)
# 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::Peak#metric
def metric
METRIC
end
# Overriding BenchmarkDriver::Runner::Peak#target
def target
'size'
end
end