mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Add quicky ab(8) wrapper
This commit is contained in:
parent
bcdd5357fb
commit
60a5478310
1 changed files with 22 additions and 0 deletions
22
test/ab_rs.rb
Normal file
22
test/ab_rs.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
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
|
Loading…
Add table
Reference in a new issue