Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

testing updates.

  • Loading branch information...
commit 31fa91d37bc6a42506240b7bc1e875582a93b0a6 1 parent 82b29ab
@treeder treeder authored
View
29 Gemfile.lock
@@ -7,15 +7,38 @@ PATH
GEM
remote: https://rubygems.org/
specs:
+ addressable (2.2.8)
beanstalk-client (1.1.1)
+ concur (0.1.2)
+ em-http-request
+ em-http-request
+ eventmachine
+ eventmachine
+ faraday
+ faraday
+ cookiejar (0.3.0)
+ em-http-request (1.0.2)
+ addressable (>= 2.2.3)
+ cookiejar
+ em-socksify
+ eventmachine (>= 1.0.0.beta.4)
+ http_parser.rb (>= 0.5.3)
+ em-socksify (0.2.0)
+ eventmachine (>= 1.0.0.beta.4)
+ eventmachine (1.0.0.rc.4)
+ faraday (0.8.1)
+ multipart-post (~> 1.1)
ffi (1.0.11)
- iron_core (0.1.4)
+ http_parser.rb (0.5.3)
+ iron_core (0.1.6)
bundler (> 1.0.0)
rest
rest-client
mime-types (1.19)
+ multipart-post (1.1.5)
+ net-http-persistent (2.7)
rake (0.9.2.2)
- rest (1.0.0)
+ rest (1.1.0)
rest-client (>= 0.3.0)
rest-client (1.6.7)
mime-types (>= 1.16)
@@ -30,7 +53,9 @@ PLATFORMS
DEPENDENCIES
beanstalk-client
+ concur
iron_mq!
+ net-http-persistent
rake
test-unit
typhoeus
View
3  iron_mq.gemspec
@@ -23,7 +23,8 @@ Gem::Specification.new do |gem|
gem.add_development_dependency "beanstalk-client"
gem.add_development_dependency "uber_config"
gem.add_development_dependency "typhoeus"
-
+ gem.add_development_dependency "concur"
+ gem.add_development_dependency "net-http-persistent"
end
View
6 test/Gemfile
@@ -1,6 +0,0 @@
-source 'http://rubygems.org'
-gem 'beanstalk-client'
-gem 'test-unit'
-gem 'concur'
-gem 'uber_config'
-gem 'iron_core'
View
48 test/Gemfile.lock
@@ -1,48 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- addressable (2.2.8)
- beanstalk-client (1.1.1)
- concur (0.1.2)
- em-http-request
- em-http-request
- eventmachine
- eventmachine
- faraday
- faraday
- cookiejar (0.3.0)
- em-http-request (1.0.2)
- addressable (>= 2.2.3)
- cookiejar
- em-socksify
- eventmachine (>= 1.0.0.beta.4)
- http_parser.rb (>= 0.5.3)
- em-socksify (0.2.0)
- eventmachine (>= 1.0.0.beta.4)
- eventmachine (1.0.0.beta.4)
- faraday (0.8.1)
- multipart-post (~> 1.1)
- http_parser.rb (0.5.3)
- iron_core (0.1.4)
- bundler (> 1.0.0)
- rest
- rest-client
- mime-types (1.18)
- multipart-post (1.1.5)
- rest (0.3.0)
- rest-client
- rest-client
- rest-client (1.6.7)
- mime-types (>= 1.16)
- test-unit (2.5.0)
- uber_config (0.0.3)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- beanstalk-client
- concur
- iron_core
- test-unit
- uber_config
View
14 test/long_run.rb
@@ -9,18 +9,18 @@
require_relative 'long_run_worker'
-@config = YAML::load_file(File.expand_path(File.join("~", "Dropbox", "configs", "iron_mq_ruby", "test", "config.yml")))
-@num_to_add = @config['count']
+@config = YAML::load_file(File.expand_path(File.join("~", "Dropbox", "configs", "iron_mq_ruby", "config.yml")))
+@num_to_add = 1000
-IronWorker.configure do |c|
- c.token = @config['iron_mq']['token']
- c.project_id = @config['iron_mq']['project_id']
-end
+#IronWorker.configure do |c|
+# c.token = @config['iron_mq']['token']
+# c.project_id = @config['iron_mq']['project_id']
+#end
worker = LongRunWorker.new
worker.config = @config
worker.num_to_add = @num_to_add
-worker.run_local
+worker.run
#worker.queue
#status = worker.wait_until_complete
#p status
View
14 test/long_run_worker.rb
@@ -1,17 +1,17 @@
-require 'iron_worker'
+require 'concur'
+require 'iron_mq'
-class LongRunWorker < IronWorker::Base
-
- merge_gem 'concur'
- merge_gem 'iron_mq'
+class LongRunWorker
attr_accessor :config, :num_to_add
def run
- @client = IronMQ::Client.new(@config['iron_mq'])
+ @client = IronMQ::Client.new(@config['iron'])
@client.queue_name = 'ironmq-gem-long'
+ @error_count = 0
+
start = Time.now
puts "Queuing #{@num_to_add} items at #{start}..."
executor = Concur::Executor.new_thread_pool_executor(50)
@@ -22,6 +22,7 @@ def run
res = @client.messages.post("hello world! #{i}")
rescue => ex
puts "ERROR! #{ex.class.name}: #{ex.message} -- #{ex.backtrace.inspect}"
+ @error_count += 1
raise ex
end
end
@@ -53,6 +54,7 @@ def run
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."
+ puts "Errors: #{@error_count}"
executor.shutdown
View
7 test/test_bulk.rb
@@ -12,15 +12,20 @@ def test_bulk
q_name = 'ironmq-gem-bulk'
queue = @client.queue(q_name)
- 1000.times do |i|
+ times = 50
+ t = Time.now
+ times.times do |i|
puts "Posting #{i}"
res = queue.post("hello world #{i}!")
end
+ puts "#{times} posts took #{Time.now.to_f - t.to_f}"
+ t = Time.now
res = nil
while (res = queue.get())
del = res.delete
end
+ puts "#{times} gets and deletes took #{Time.now.to_f - t.to_f}"
end
Please sign in to comment.
Something went wrong with that request. Please try again.