class OkComputer::SidekiqLatencyCheck

Attributes

queue[RW]

Public Class Methods

new(queue, threshold = 30) click to toggle source

Public: Initialize a check for a backed-up Sidekiq queue See github.com/mperham/sidekiq/wiki/Monitoring#monitoring-queue-latency

queue - The name of the Sidekiq queue to check threshold - An Integer to compare the queue’s latency against to consider

it backed up
# File lib/ok_computer/built_in_checks/sidekiq_latency_check.rb, line 16
def initialize(queue, threshold = 30)
  self.queue = queue
  self.name = "Sidekiq queue '#{queue}' latency"
  self.threshold = Integer(threshold)
end

Public Instance Methods

size() click to toggle source

Public: The latency of the check’s queue (in seconds)

# File lib/ok_computer/built_in_checks/sidekiq_latency_check.rb, line 23
def size
  Sidekiq::Queue.new(queue).latency
end