Class: QueuePulse::Checks::QueueDepth

Inherits:
Base
  • Object
show all
Defined in:
lib/queue_pulse/checks/queue_depth.rb

Overview

Alerts when a queue's ready depth exceeds queue_depth_threshold. Cooldown is per-queue. (Requirements US-3.2, US-3.3.)

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from QueuePulse::Checks::Base

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/queue_pulse/checks/queue_depth.rb', line 8

def call
  threshold = config.queue_depth_threshold

  source.queue_stats.filter_map do |stat|
    next if stat.depth < threshold

    with_cooldown("queue_depth:#{stat.queue_name}") do
      depth_alert(stat)
    end
  end
end