Skip to content

Commit

Permalink
Add quicky ab(8) wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Dec 1, 2011
1 parent bcdd535 commit 60a5478
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/ab_rs.rb
@@ -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

0 comments on commit 60a5478

Please sign in to comment.