Class: Roqua::Probes::DelayedJobProbe

Inherits:
Object
  • Object
show all
Includes:
BaseProbe
Defined in:
lib/roqua/probes/delayed_job_probe.rb

Instance Method Summary collapse

Methods included from BaseProbe

#call

Instance Method Details

#backlog_countObject



8
9
10
# File 'lib/roqua/probes/delayed_job_probe.rb', line 8

def backlog_count
  Delayed::Job.where(locked_at: nil).where('run_at < ?', Time.zone.now).count
end

#runObject



12
13
14
# File 'lib/roqua/probes/delayed_job_probe.rb', line 12

def run
  Appsignal.set_gauge('delayed_job_backlog_count', backlog_count)
end