Class: Resque::Integration::QueuesInfo::Size

Inherits:
Object
  • Object
show all
Defined in:
lib/resque/integration/queues_info/size.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Size

Returns a new instance of Size.



5
6
7
# File 'lib/resque/integration/queues_info/size.rb', line 5

def initialize(config)
  @config = config
end

Instance Method Details

#overallObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/resque/integration/queues_info/size.rb', line 13

def overall
  max = 0

  Resque.queues.each do |queue|
    size = Resque.size(queue).to_i
    next if size < threshold(queue)
    max = size if size > max
  end

  max
end

#size(queue) ⇒ Object



9
10
11
# File 'lib/resque/integration/queues_info/size.rb', line 9

def size(queue)
  Resque.size(queue) || 0
end