Class: NewRelic::Agent::Instrumentation::ActionCableSubscriber

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

Constant Summary collapse

PERFORM_ACTION =
'perform_action.action_cable'.freeze

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, #state, subscribe, subscribed?

Constructor Details

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

Instance Method Details

#start_segment(name, id, payload) ⇒ Object

THREAD_LOCAL_ACCESS



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/new_relic/agent/instrumentation/action_cable_subscriber.rb', line 13

def start_segment(name, id, payload) # THREAD_LOCAL_ACCESS
  finishable = if name == PERFORM_ACTION
    Tracer.start_transaction_or_segment(
      name: transaction_name_from_payload(payload),
      category: :action_cable
    )
  else
    Tracer.start_segment(name: metric_name_from_payload(name, payload))
  end
  push_segment(id, finishable)
end