Class: Autoscaler::Sidekiq::EntireQueueSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/autoscaler/sidekiq/entire_queue_system.rb

Overview

Interface to to interrogate the queuing system Includes every queue

Instance Method Summary collapse

Instance Method Details

#queue_namesArray[String]



30
31
32
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 30

def queue_names
  sidekiq_queues.keys
end

#queuedInteger



15
16
17
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 15

def queued
  sidekiq_queues.values.map(&:to_i).reduce(&:+) || 0
end

#retryingInteger



25
26
27
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 25

def retrying
  ::Sidekiq::RetrySet.new.size
end

#scheduledInteger



20
21
22
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 20

def scheduled
  ::Sidekiq::ScheduledSet.new.size
end

#workersInteger



9
10
11
12
# File 'lib/autoscaler/sidekiq/entire_queue_system.rb', line 9

def workers
  ::Sidekiq::Workers.new.map {|pid, _, _| pid}.uniq.size
  # #size may be out-of-date.
end