Sha256: f6e7bc8d37a4341277f3c50a5ac7d84c3ef592dbae16d719a3fba05266966e00
Contents?: true
Size: 1.33 KB
Versions: 1
Compression:
Stored size: 1.33 KB
Contents
#!/usr/bin/env ruby $:.unshift File.expand_path('../lib', __dir__) require 'benchmark_driver' require 'optparse' require 'yaml' options = {} args = OptionParser.new do |o| o.banner = "Usage: #{File.basename($0, '.*')} [options] [YAML]" o.on('-e', '--executables [EXECS]', 'Ruby executables (e1::path1; e2::path2; e3::path3;...)') do |e| options[:execs] ||= [] e.split(/;/).each do |path| options[:execs] << path end end o.on('-r', '--rbenv [VERSION]', 'Ruby executable in rbenv') do |r| options[:execs] ||= [] options[:execs] << "#{r}::RBENV_VERSION='#{r}' ruby" end o.on('-i [DURATION]', '--ips [SECONDS]', "Measure IPS in duration seconds (default: #{BenchmarkDriver::DEFAULT_IPS_DURATION})") do |i| options[:measure_type] = 'ips' options[:measure_num] = Integer(i) if i end o.on('-l [COUNT]', '--loop-count [COUNT]', "Measure execution time with loop count (default: #{BenchmarkDriver::DEFAULT_LOOP_COUNT})") do |l| options[:measure_type] = 'loop_count' options[:measure_num] = Integer(l) if l end o.on('-v', '--verbose') do |v| options[:verbose] = v end end.parse!(ARGV) abort "No YAML file is specified" if args.empty? driver = BenchmarkDriver.new(options) args.each do |yaml| default = { name: File.basename(yaml, '.*') } driver.run(default.merge(YAML.load(File.read(yaml)))) end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
benchmark_driver-0.2.3 | exe/benchmark_driver |