mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Remove oddly named stats.rb
This commit is contained in:
parent
725213d9a7
commit
1785f02d1b
2 changed files with 12 additions and 14 deletions
|
@ -4,7 +4,6 @@ require 'sidekiq/client'
|
|||
require 'sidekiq/worker'
|
||||
require 'sidekiq/redis_connection'
|
||||
require 'sidekiq/util'
|
||||
require 'sidekiq/stats'
|
||||
require 'sidekiq/api'
|
||||
|
||||
require 'sidekiq/extensions/class_methods'
|
||||
|
@ -109,4 +108,16 @@ module Sidekiq
|
|||
self.options[:poll_interval] = interval
|
||||
end
|
||||
|
||||
##
|
||||
# deprecated
|
||||
def self.size(*queues)
|
||||
return Sidekiq::Stats.new.enqueued if queues.empty?
|
||||
|
||||
Sidekiq.redis { |conn|
|
||||
conn.multi {
|
||||
queues.map { |q| conn.llen("queue:#{q}") }
|
||||
}
|
||||
}.inject(0) { |memo, count| memo += count }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
module Sidekiq
|
||||
module_function
|
||||
|
||||
def size(*queues)
|
||||
return Sidekiq::Stats.new.enqueued if queues.empty?
|
||||
|
||||
Sidekiq.redis { |conn|
|
||||
conn.multi {
|
||||
queues.map { |q| conn.llen("queue:#{q}") }
|
||||
}
|
||||
}.inject(0) { |memo, count| memo += count }
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue