Class: Metrician::Resque

Inherits:
Reporter show all
Defined in:
lib/metrician/reporters/resque.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/resque.rb', line 4

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

Instance Method Details

#instrumentObject



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

def instrument
  require "metrician/jobs/resque_plugin"
  unless ::Resque::Job.method_defined?(:payload_class_with_metrician)
    ::Resque::Job.send(:include, Metrician::Jobs::ResquePlugin::Installer)
  end
end