Created
August 5, 2014 21:38
-
-
Save treeder/59f1511d6fed03e50df2 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
source 'https://rubygems.org' | |
gem 'iron_mq', :git => 'https://github.com/iron-io/iron_mq_ruby.git', :branch => 'v3' | |
gem 'quicky' | |
gem 'go' | |
gem 'uber_config' |
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 'quicky' | |
require 'iron_mq' | |
NUM_MESSAGES = 10 | |
@client = IronMQ::Client.new(:host => "", | |
project_id: "", | |
token: "" | |
) | |
queue_name = "quick_#{rand(1000)}" | |
queue = @client.queue(queue_name) | |
quicky = Quicky::Timer.new | |
j = 0 | |
quicky.loop(:post, NUM_MESSAGES) do |i| | |
puts "==== POSTING #{i || j} ==================================" | |
j += 1 | |
body = "hello #{j}" | |
res = queue.post(body) | |
end | |
j = 0 | |
while (msg = queue.reserve) != nil do | |
puts "==== GOT #{j} ===================" | |
puts msg.id | |
j += 1 | |
end | |
puts "using queue #{queue_name}" | |
puts "count: #{quicky.results(:post).count}" | |
puts "avg post: #{quicky.results(:post).duration}" | |
puts "queue size: #{queue.reload.size}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment