Class: RailsPerformance::Gems::DelayedJobExt::Plugin

Inherits:
Delayed::Plugin
  • Object
show all
Defined in:
lib/rails_performance/gems/delayed_job_ext.rb

Class Method Summary collapse

Class Method Details

.meta(payload_object) ⇒ Object

source_type, class_name, method_name, duration


33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rails_performance/gems/delayed_job_ext.rb', line 33

def self.meta(payload_object)
  if payload_object.is_a?(::Delayed::PerformableMethod)
    if payload_object.object.is_a?(Module)
      [:class_method, payload_object.object.name, payload_object.method_name.to_s]
    else
      [:instance_method, payload_object.object.class.name, payload_object.method_name.to_s]
    end
  else
    [:instance_method, payload_object.class.name, "perform"]
  end
rescue
  [:unknown, :unknown, :unknown]
end