Created
September 1, 2011 04:16
-
-
Save nandayadav/1185438 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
Gems included by the bundle: | |
* activemodel (3.1.0.rc6) | |
* activerecord (3.1.0.rc6) | |
* activesupport (3.1.0.rc6) | |
* addressable (2.2.6) | |
* arel (2.2.1) | |
* async-rack (0.5.1) | |
* bcrypt-ruby (2.1.4) | |
* builder (3.0.0) | |
* bundler (1.0.18) | |
* em-http-request (1.0.0) | |
* em-socksify (0.1.0) | |
* em-synchrony (1.0.0) | |
* eventmachine (1.0.0.beta.3) | |
* goliath (0.9.2 c8008ef) | |
* http_parser.rb (0.5.2) | |
* http_router (0.9.7) | |
* i18n (0.6.0) | |
* log4r (1.1.9) | |
* multi_json (1.0.3) | |
* mysql2 (0.3.7) | |
* rack (1.3.2) | |
* rack-accept-media-types (0.9) | |
* rack-contrib (1.1.0) | |
* rack-respond_to (0.9.8) | |
* tzinfo (0.3.29) | |
* url_mount (0.2.1) | |
* yajl-ruby (0.8.3) |
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 "bundler/setup" | |
require 'eventmachine' | |
require 'em-http' | |
start = Time.now | |
#Parallel requests | |
EventMachine.run do | |
multi = EventMachine::MultiRequest.new | |
200.times do |id| | |
puts id | |
http = EventMachine::HttpRequest.new("http://localhost:9000/echo_with_ar") | |
req = http.get | |
multi.add(id, req) | |
end | |
multi.callback do | |
puts multi.responses[:succeeded] | |
puts multi.responses[:failed] | |
EventMachine.stop | |
end | |
end | |
end_t = Time.now | |
puts "Elapsed: #{end_t - start} secs" | |
#ruby runner.rb to invoke |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment