lib/benchmark/http/command/concurrency.rb in benchmark-http-0.7.0 vs lib/benchmark/http/command/concurrency.rb in benchmark-http-0.8.0
- old
+ new
@@ -34,10 +34,11 @@
self.description = "Determine the optimal level of concurrency."
options do
option '-t/--threshold <factor>', "The acceptable latency penalty when making concurrent requests", default: 1.2, type: Float
option '-c/--confidence <factor>', "The confidence required when computing latency (lower is less reliable but faster)", default: 0.99, type: Float
+ option '-m/--minimum <count>', "The minimum number of connections to make", default: 1, type: Integer
end
many :hosts, "One or more hosts to benchmark"
def confidence_factor
@@ -78,15 +79,15 @@
puts "I am going to benchmark #{url}..."
Async::Reactor.run do |task|
statistics = []
- minimum = 1
+ minimum = @options[:minimum]
base = measure_performance(minimum, endpoint, request_path)
statistics << base
- current = 2
+ current = minimum * 2
maximum = nil
while statistics.last.concurrency < current
results = measure_performance(current, endpoint, request_path)