Skip to content

Instantly share code, notes, and snippets.

@iorionda
Created March 21, 2013 14:34
Show Gist options
  • Select an option

  • Save iorionda/5213492 to your computer and use it in GitHub Desktop.

Select an option

Save iorionda/5213492 to your computer and use it in GitHub Desktop.
うわー
#!/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