Sha256: e367c11642d6c7f103be1f7a575436534a07da3e103342df4d592727119ddc2c

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

require 'yaml'
begin
  require File.join(File.dirname(__FILE__), '../lib/ironmq')
rescue Exception => ex
  puts "Could NOT load current ironmq: " + ex.message
  raise ex
end

@config = YAML::load_file(File.expand_path(File.join("~", "Dropbox", "configs", "ironmq_gem", "test", "config.yml")))
@client = IronMQ::Client.new(@config['ironmq'])
@client.queue_name = 'ironmq-gem-tests'
@num_to_add = @config['count']

start = Time.now
puts "Queuing #{@num_to_add} items at #{start}..."
@num_to_add.times do |i|
	puts "POST #{i}..."
	res = @client.messages.post("hello world! #{i}")
	p res
end
put_time = (Time.now.to_f - start.to_f)
puts "Finished pushing in #{put_time} seconds"

start = Time.now
puts "Getting and deleting #{@num_to_add} items at #{start}..."
@num_to_add.times do |i|
    puts "GET #{i}..."
    res = @client.messages.get()
    p res
    puts "DELETE #{i}..."
    res = @client.messages.delete(res["id"])
    p res
end

puts "Finished pushing #{@num_to_add} items in #{put_time} seconds."
puts "Finished getting and deleting #{@num_to_add} items in #{(Time.now.to_f - start.to_f)} seconds."

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ironmq-1.2.5 test/long_run.rb