Created
March 21, 2013 14:34
-
-
Save iorionda/5213492 to your computer and use it in GitHub Desktop.
うわー
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 characters
| #!/usr/local/env ruby | |
| # -*- coding: utf-8 -*- | |
| require 'rubygems' | |
| require 'typhoeus' | |
| request = [] | |
| hydra = Typhoeus::Hydra.new(:max_concurrency => 32) | |
| 1000.times.map do | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/ZzLMrmPD', followlocation: true)) | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/1YNFKE5A', followlocation: true)) | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/6zoNdUnS', followlocation: true)) | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/d8QlRzrL', followlocation: true)) | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/IKQU0xjb', followlocation: true)) | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/QCNNU40Y', followlocation: true)) | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/UHCwd88m', followlocation: true)) | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/yKBcBTro', followlocation: true)) | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/5S2nihj3', followlocation: true)) | |
| hydra.queue(Typhoeus::Request.new('192.168.0.6:3030/cNCAnPbx', followlocation: true)) | |
| end | |
| from = Time.now.instance_eval { '%s.%03d' % [strftime('%Y/%m/%d %H:%M:%S'), (usec / 1000.0).round] } | |
| puts from | |
| hydra.run | |
| to = Time.now.instance_eval { '%s.%03d' % [strftime('%Y/%m/%d %H:%M:%S'), (usec / 1000.0).round] } | |
| puts to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment