summaryrefslogtreecommitdiff
path: root/benchmark/lib/benchmark_driver/runner/size.rb
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-10 12:14:04 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-10 12:14:04 +0000
commit12a38cbac0bc7ff7be4b05e2e7d4f0ca76df7bf4 (patch)
treee4472b4f4ff6ed5e32855616b5721574f27636fb /benchmark/lib/benchmark_driver/runner/size.rb
parentd8583b132c4ce3c203c9f5a117fd581c8c7eb6fe (diff)
benchmark: resurrect peak / size metrics
by adding runner plugins for them. benchmark/lib/benchmark_driver/runner/peak.rb: added peak runner plugin benchmark/lib/benchmark_driver/runner/size.rb: added size runner plugin common.mk: allow using them benchmark/memory_wrapper.rb: deleted in favor of those runner plugins benchmark/README.md: document them git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark/lib/benchmark_driver/runner/size.rb')
-rw-r--r--benchmark/lib/benchmark_driver/runner/size.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/benchmark/lib/benchmark_driver/runner/size.rb b/benchmark/lib/benchmark_driver/runner/size.rb
new file mode 100644
index 0000000..e3ec820
--- /dev/null
+++ b/benchmark/lib/benchmark_driver/runner/size.rb
@@ -0,0 +1,20 @@
+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#target
+ def target
+ 'size'
+ end
+end