class Drnbench::RequestResponse::ProgressiveRunner

Attributes

report_progressively[R]
result[R]

Public Class Methods

new(config) click to toggle source
# File lib/drnbench/request-response/progressive-runner.rb, line 24
def initialize(config)
  @config = config
end

Public Instance Methods

run() click to toggle source
# File lib/drnbench/request-response/progressive-runner.rb, line 28
def run
  run_benchmarks
  @result
end

Private Instance Methods

run_benchmarks() click to toggle source
# File lib/drnbench/request-response/progressive-runner.rb, line 34
def run_benchmarks
  @result = Result.new
  @config.start_n_clients.step(@config.end_n_clients, @config.step) do |n_clients|
    sleep @config.interval unless @result.empty?

    benchmark = Runner.new(n_clients, @config)
    if @config.report_progressively
      puts "Running benchmark with #{n_clients} clients..."
    end
    benchmark.run
    if @config.report_progressively
      puts benchmark.result.to_s
      puts ""
    end
    @result << benchmark.result
  end
end