Class: Resque::Integration::QueuesInfo::Size
- Inherits:
-
Object
- Object
- Resque::Integration::QueuesInfo::Size
- Defined in:
- lib/resque/integration/queues_info/size.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Size
constructor
A new instance of Size.
- #overall ⇒ Object
- #size(queue) ⇒ Object
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
#overall ⇒ Object
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 |