-
-
Save trptcolin/2155418 to your computer and use it in GitHub Desktop.
Revisions
-
trptcolin revised this gist
Mar 22, 2012 . 1 changed file with 15 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,26 @@ #!/usr/bin/env ruby require 'thread' require 'rubygems' require 'typhoeus' mutex = Mutex.new 100000.times do |t| Thread.new do puts "requesting - #{t}" req = Typhoeus::Request.new("http://#{ARGV[0]}:#{ARGV[1]}", :method => :post, :body => "something=somethingelse") # this is still problematic: see all the shared state in # https://github.com/dbalatero/typhoeus/blob/master/lib/typhoeus/hydra.rb Typhoeus::Hydra.hydra.queue req mutex.synchronize do Typhoeus::Hydra.hydra.run end end end -
blakesmith revised this gist
Mar 22, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -13,5 +13,5 @@ Typhoeus::Hydra.hydra.queue @req Typhoeus::Hydra.hydra.run end end -
blakesmith created this gist
Mar 22, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/usr/bin/env ruby require 'rubygems' require 'typhoeus' 100000.times do |t| Thread.new do puts "requesting - #{t}" @req = Typhoeus::Request.new("http://#{ARGV[0]}:#{ARGV[1]}", :method => :post, :body => "something=somethingelse") Typhoeus::Hydra.hydra.queue @req Typhoeus::Hydra.hydra.run end.join end This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ #!/usr/bin/env ruby require 'rubygems' require 'sinatra' post '/' do "hello there!" end