ruby-changes:51720
From: k0kubun <ko1@a...>
Date: Tue, 10 Jul 2018 23:17:02 +0900 (JST)
Subject: [ruby-changes:51720] k0kubun:r63932 (trunk): runner/size.rb: fix metric passed to output
k0kubun 2018-07-10 23:16:57 +0900 (Tue, 10 Jul 2018) New Revision: 63932 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63932 Log: 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. Modified files: trunk/benchmark/lib/benchmark_driver/runner/peak.rb trunk/benchmark/lib/benchmark_driver/runner/size.rb Index: benchmark/lib/benchmark_driver/runner/peak.rb =================================================================== --- benchmark/lib/benchmark_driver/runner/peak.rb (revision 63931) +++ benchmark/lib/benchmark_driver/runner/peak.rb (revision 63932) @@ -40,7 +40,7 @@ class BenchmarkDriver::Runner::Peak https://github.com/ruby/ruby/blob/trunk/benchmark/lib/benchmark_driver/runner/peak.rb#L40 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 https://github.com/ruby/ruby/blob/trunk/benchmark/lib/benchmark_driver/runner/peak.rb#L80 'peak' end + # Overridden by BenchmarkDriver::Runner::Size + def metric + METRIC + end + def with_script(script) if @config.verbose >= 2 sep = '-' * 30 Index: benchmark/lib/benchmark_driver/runner/size.rb =================================================================== --- benchmark/lib/benchmark_driver/runner/size.rb (revision 63931) +++ benchmark/lib/benchmark_driver/runner/size.rb (revision 63932) @@ -13,6 +13,11 @@ class BenchmarkDriver::Runner::Size < Be https://github.com/ruby/ruby/blob/trunk/benchmark/lib/benchmark_driver/runner/size.rb#L13 private + # Overriding BenchmarkDriver::Runner::Peak#metric + def metric + METRIC + end + # Overriding BenchmarkDriver::Runner::Peak#target def target 'size' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/