Created
March 8, 2013 17:05
-
-
Save kazjote/5118020 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
require 'httparty' | |
Array.new(32) {|i| i}.map do |worker| | |
fork do | |
file = File.open("worker_#{worker}.log", "w") | |
1000.times do |i| | |
url = "http://localhost:9290/tests/test1.txt" | |
page = HTTParty.get(url) | |
file.puts("==============") | |
file.puts("url: #{url}") | |
file.puts "" | |
file.puts page.code | |
file.puts page.body | |
unless page.body.include?(%Q{test1}) | |
puts "ERROR" | |
file.puts "ERROR! body empty?!" | |
end | |
end | |
file.close | |
end | |
end | |
Array.new(32) do | |
fork do | |
1000.times do | |
HTTParty.get("http://localhost:9290/tests/test2") | |
end | |
end | |
end | |
Process.waitall | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment