Created
April 8, 2010 15:19
-
-
Save lucaspiller/360176 to your computer and use it in GitHub Desktop.
Patron benchmark
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
require 'rubygems' | |
require 'patron' | |
50.times do | |
Thread.new do | |
print "+ Start\n" | |
session = Patron::Session.new | |
session.timeout = 30000 | |
session.connect_timeout = 30000 | |
session.base_url = 'http://www.google.com/' | |
session.get 'search' | |
print "- Done\n" | |
end | |
end | |
while Thread.list.count > 1 | |
# waiting for threads | |
sleep 0.1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment