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:
parent
ec39f15f48
commit
bff2d36f86
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue