summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-10 14:16:57 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-10 14:16:57 (GMT)
commit79a8c10b0b48eedefc7ee96fd3514adfb1d6c8e0 (patch)
tree8c8e1594f605bf9c27b69d6041be9a2fcf0e2b66 /benchmark
parent34eed0cd472e50ebeabcffbb00f9f0a2b93909d2 (diff)
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
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/lib/benchmark_driver/runner/peak.rb7
-rw-r--r--benchmark/lib/benchmark_driver/runner/size.rb5
2 files changed, 11 insertions, 1 deletions
diff --git a/benchmark/lib/benchmark_driver/runner/peak.rb b/benchmark/lib/benchmark_driver/runner/peak.rb
index e00d667..0ba8af4 100644
--- a/benchmark/lib/benchmark_driver/runner/peak.rb
+++ b/benchmark/lib/benchmark_driver/runner/peak.rb
@@ -40,7 +40,7 @@ class BenchmarkDriver::Runner::Peak
run_benchmark(job, context: context)
end
@output.with_context(name: context.name, executable: context.executable, gems: context.gems, prelude: context.prelude) do
- @output.report(values: { METRIC => value }, loop_count: job.loop_count)
+ @output.report(values: { metric => value }, loop_count: job.loop_count)
end
end
end
@@ -80,6 +80,11 @@ class BenchmarkDriver::Runner::Peak
'peak'
end
+ # Overridden by BenchmarkDriver::Runner::Size
+ def metric
+ METRIC
+ end
+
def with_script(script)
if @config.verbose >= 2
sep = '-' * 30
diff --git a/benchmark/lib/benchmark_driver/runner/size.rb b/benchmark/lib/benchmark_driver/runner/size.rb
index e3ec820..1b31f90 100644
--- a/benchmark/lib/benchmark_driver/runner/size.rb
+++ b/benchmark/lib/benchmark_driver/runner/size.rb
@@ -13,6 +13,11 @@ class BenchmarkDriver::Runner::Size < BenchmarkDriver::Runner::Peak
private
+ # Overriding BenchmarkDriver::Runner::Peak#metric
+ def metric
+ METRIC
+ end
+
# Overriding BenchmarkDriver::Runner::Peak#target
def target
'size'