1
0
Fork 0
mirror of https://github.com/deanpcmad/sidekiq-limit_fetch.git synced 2022-11-09 13:54:36 -05:00

Update bench/compare to work with current version

This commit is contained in:
brainopia 2014-08-18 10:46:45 +04:00
parent ec39f15f48
commit bff2d36f86

View file

@ -1,5 +1,6 @@
require 'benchmark'
require 'sidekiq/cli'
require 'sidekiq/api'
total = (ARGV.shift || 50).to_i
concurrency = ARGV.shift || 1
@ -12,6 +13,7 @@ if limit
require 'sidekiq-limit_fetch'
Sidekiq::Queue['inline'].limit = limit
Sidekiq.redis {|it| it.del 'limit_fetch:probed:inline' }
Sidekiq::LimitFetch::Queues.send(:define_method, :set) {|*| }
end
Sidekiq::Queue.new('inline').clear
@ -40,6 +42,7 @@ FinishJob.perform_async
Sidekiq::CLI.instance.tap do |cli|
%w(validate! boot_system).each {|stub| cli.define_singleton_method(stub) {}}
cli.parse ['-q inline', '-q other', "-c #{concurrency}"]
puts Benchmark.measure {
begin
cli.run