Skip to content

Instantly share code, notes, and snippets.

@danmayer
Created June 2, 2009 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danmayer/122327 to your computer and use it in GitHub Desktop.
Save danmayer/122327 to your computer and use it in GitHub Desktop.
desc "Perform some benchmarking against the production site"
task :benchmark do
puts "starting benchmarking"
fork_and_print("ab -c 100 -t 130 -n 1000 -r http://site.com/")
fork_and_print("ab -c 100 -t 130 -n 1000 -r http://site.com/contact")
fork_and_print("ab -c 100 -t 130 -n 1000 -r http://site.com/documentation/how_it_works")
fork_and_print("ab -c 100 -t 130 -n 1000 -r http://site.com/documentation/installt")
Process.waitall
puts "benchmarking complete"
end
def fork_and_print(cmd)
pid = fork do
results = `#{cmd}`
puts results
end
pid
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment