1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/test/ab_rs.rb

23 lines
412 B
Ruby
Raw Normal View History

2011-12-01 17:34:03 -05:00
url = ARGV.shift
count = (ARGV.shift || 1000).to_i
STDOUT.sync = true
1.upto(5) do |i|
print "#{i}: "
str = `ab -n #{count} -c #{i} #{url} 2>/dev/null`
rs = /Requests per second:\s+([\d.]+)\s/.match(str)
puts rs[1]
end
puts "Keep Alive:"
1.upto(5) do |i|
print "#{i}: "
str = `ab -n #{count} -k -c #{i} #{url} 2>/dev/null`
rs = /Requests per second:\s+([\d.]+)\s/.match(str)
puts rs[1]
end