require 'sidekiq/api' require 'roo_on_rails/sidekiq/queue_latency' require 'roo_on_rails/sidekiq/process_scaling' module RooOnRails module Sidekiq # Returns stats on the current SLA performance of queues in a Sidekiq instance. # # Assumes workers are not bound to queues. class SlaMetric def self.queue queues = ::Sidekiq::Queue.all.map { |q| QueueLatency.new(q) } global_stats = ProcessScaling.new(queues) global_stats.requested_processes end end end end