Class: NewRelic::Agent::Instrumentation::ActionMailboxSubscriber

Inherits:
NotificationsSubscriber show all
Defined in:
lib/new_relic/agent/instrumentation/action_mailbox_subscriber.rb

Constant Summary collapse

PATTERN =
/\A([^\.]*)\.action_mailbox\z/
METHOD_NAME_MAPPING =
Hash.new do |h, k|
  if PATTERN =~ k
    h[k] = $1
  else
    h[k] = NewRelic::UNKNOWN
  end
end

Instance Method Summary collapse

Methods inherited from NotificationsSubscriber

#add_segment_params, #define_exception_method, find_all_subscribers, #finish, #finish_segment, #initialize, #log_notification_error, #pop_segment, #push_segment, #segment_stack, #start, #start_segment, #state, subscribe, subscribed?

Constructor Details

This class inherits a constructor from NewRelic::Agent::Instrumentation::NotificationsSubscriber

Instance Method Details

#method_from_name(name) ⇒ Object



27
28
29
# File 'lib/new_relic/agent/instrumentation/action_mailbox_subscriber.rb', line 27

def method_from_name(name)
  METHOD_NAME_MAPPING[name]
end

#metric_name(name, payload) ⇒ Object



11
12
13
14
15
# File 'lib/new_relic/agent/instrumentation/action_mailbox_subscriber.rb', line 11

def metric_name(name, payload)
  mailbox = payload[:mailbox].class.name
  method = method_from_name(name)
  "Ruby/ActionMailbox/#{mailbox}/#{method}"
end