Class: SidekiqVigil::Check::ScheduledBacklog
- Defined in:
- lib/sidekiq_vigil/check/scheduled_backlog.rb
Instance Attribute Summary
Attributes inherited from Base
#api, #clock, #logger, #options, #storage
Instance Method Summary collapse
Methods inherited from Base
#check_name, #execute, #initialize
Constructor Details
This class inherits a constructor from SidekiqVigil::Check::Base
Instance Method Details
#call ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/sidekiq_vigil/check/scheduled_backlog.rb', line 6 def call overdue_count = api.scheduled.count do |job| = job.respond_to?(:at) ? job.at : Time.at(job.score.to_f) <= clock.call - .fetch(:overdue, 300) end threshold_result( target: "global", value: overdue_count, warn: .fetch(:warn, 1), critical: .fetch(:critical, 100), message: "#{overdue_count} overdue scheduled jobs" ) end |