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

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

Class Method Summary collapse

Class Method Details

.enableObject



7
8
9
# File 'lib/inst_jobs_statsd/stats/periodic/failed.rb', line 7

def self.enable
  enable_failed_depth
end

.enable_failed_depthObject



11
12
13
14
# File 'lib/inst_jobs_statsd/stats/periodic/failed.rb', line 11

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

.report_failed_depthObject



16
17
18
19
# File 'lib/inst_jobs_statsd/stats/periodic/failed.rb', line 16

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