Module: BenchmarkDriver::Runner
- Defined in:
- lib/benchmark_driver/runner.rb
Defined Under Namespace
Classes: CommandStdout, Ips, Memory, Once, Recorded, Time
Class Method Summary collapse
-
.run(jobs, config:) ⇒ Object
Main function which is used by both CLI and
Benchmark.driver.
Class Method Details
.run(jobs, config:) ⇒ Object
Main function which is used by both CLI and Benchmark.driver.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/benchmark_driver/runner.rb', line 15 def run(jobs, config:) if config.verbose >= 1 config.executables.each do |exec| $stdout.puts "#{exec.name}: #{IO.popen([*exec.command, '-v'], &:read)}" end end runner_config = Config::RunnerConfig.new( executables: config.executables, repeat_count: config.repeat_count, run_duration: config.run_duration, verbose: config.verbose, ) jobs.group_by(&:class).each do |klass, jobs_group| runner = runner_for(klass) output = Output.find(config.output_type).new( jobs: jobs, executables: config.executables, ) runner.new(config: runner_config, output: output).run(jobs) end end |