Module: LiebreNewRelic::Instrumentation::Consumer

Defined in:
lib/liebre_newrelic/instrumentation/consumer.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/liebre_newrelic/instrumentation/consumer.rb', line 7

def self.included(base)
  
  base.class_eval do
    include NewRelic::Agent::Instrumentation::ControllerInstrumentation
    
    alias_method :orig_call_consumer, :call_consumer
    
    def call_consumer payload, meta
      NewRelic::Agent.set_transaction_name "#{klass.name}/consume"
      orig_call_consumer payload, meta
    end
    add_transaction_tracer :call_consumer, :category => :task
    
  end
  
end