Class: Autoscaler::Sidekiq::EntireQueueSystem
- Inherits:
-
Object
- Object
- Autoscaler::Sidekiq::EntireQueueSystem
- Defined in:
- lib/autoscaler/sidekiq/entire_queue_system.rb
Overview
Interface to to interrogate the queuing system Includes every queue
Instance Method Summary collapse
- #queue_names ⇒ Array[String]
-
#queued ⇒ Integer
Amount work ready to go.
-
#retrying ⇒ Integer
Amount of work still being retried.
-
#scheduled ⇒ Integer
Amount of work scheduled for some time in the future.
-
#workers ⇒ Integer
Number of worker actively engaged.
Instance Method Details
#queue_names ⇒ Array[String]
29 30 31 |
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 29 def queue_names sidekiq_queues.keys end |
#queued ⇒ Integer
Returns amount work ready to go.
14 15 16 |
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 14 def queued sidekiq_queues.values.map(&:to_i).reduce(&:+) || 0 end |
#retrying ⇒ Integer
Returns amount of work still being retried.
24 25 26 |
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 24 def count_sorted_set("retry") end |
#scheduled ⇒ Integer
Returns amount of work scheduled for some time in the future.
19 20 21 |
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 19 def scheduled count_sorted_set("schedule") end |
#workers ⇒ Integer
Returns number of worker actively engaged.
9 10 11 |
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 9 def workers ::Sidekiq::Workers.new.size end |