Module: InstJobsStatsd::Stats::Periodic::Failed

Defined in:
lib/inst_jobs_statsd/stats/periodic/failed.rb

Class Method Summary collapse

Class Method Details

.enableObject



5
6
7
# File 'lib/inst_jobs_statsd/stats/periodic/failed.rb', line 5

def self.enable
  enable_failed_depth
end

.enable_failed_depthObject



9
10
11
12
# File 'lib/inst_jobs_statsd/stats/periodic/failed.rb', line 9

def self.enable_failed_depth
  Periodic.enable_callbacks
  Periodic.add(-> { report_failed_depth })
end

.report_failed_depthObject



14
15
16
17
# File 'lib/inst_jobs_statsd/stats/periodic/failed.rb', line 14

def self.report_failed_depth
  count = Delayed::Job::Failed.count
  Periodic.report_gauge(:failed_depth, count)
end