Sha256: f073b09b0e0e867b79a56e55238056f2a5ccb39a7c5c28e996934e447144631a

Contents?: true

Size: 517 Bytes

Versions: 3

Compression:

Stored size: 517 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
roo_on_rails-1.7.0 lib/roo_on_rails/sidekiq/sla_metric.rb
roo_on_rails-1.6.0 lib/roo_on_rails/sidekiq/sla_metric.rb
roo_on_rails-1.5.0 lib/roo_on_rails/sidekiq/sla_metric.rb