Class: Metrician::DelayedJob

Inherits:
Reporter show all
Defined in:
lib/metrician/reporters/delayed_job.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Reporter

all, inherited

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


4
5
6
7
# File 'lib/metrician/reporters/delayed_job.rb', line 4

def self.enabled?
  !!defined?(::Delayed::Worker) &&
    Metrician::Jobs.enabled?
end

Instance Method Details

#instrumentObject



9
10
11
12
13
14
# File 'lib/metrician/reporters/delayed_job.rb', line 9

def instrument
  require "metrician/jobs/delayed_job_callbacks"
  unless ::Delayed::Worker.plugins.include?(::Metrician::Jobs::DelayedJobCallbacks)
    ::Delayed::Worker.plugins << ::Metrician::Jobs::DelayedJobCallbacks
  end
end