Created
June 2, 2009 16:02
-
-
Save danmayer/122327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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