class Mmtrix::Agent::Instrumentation::ActionViewSubscriber

Public Instance Methods

finish(name, id, payload) click to toggle source
# File lib/mmtrix/agent/instrumentation/action_view_subscriber.rb, line 26
def finish(name, id, payload) #THREAD_LOCAL_ACCESS
  event = pop_event(id)

  state = Mmtrix::Agent::TransactionState.tl_get

  if state.is_execution_traced? && event.recordable?
    stack = state.traced_method_stack
    frame = stack.pop_frame(state, event.frame, event.metric_name, event.end)
    record_metrics(event, frame)
  end
rescue => e
  log_notification_error(e, name, 'finish')
end
record_metrics(event, frame) click to toggle source
# File lib/mmtrix/agent/instrumentation/action_view_subscriber.rb, line 40
def record_metrics(event, frame) #THREAD_LOCAL_ACCESS
  exclusive = event.duration - frame.children_time
  Mmtrix::Agent.instance.stats_engine.tl_record_scoped_and_unscoped_metrics(
    event.metric_name, nil, event.duration, exclusive)
end
start(name, id, payload) click to toggle source
# File lib/mmtrix/agent/instrumentation/action_view_subscriber.rb, line 12
def start(name, id, payload) #THREAD_LOCAL_ACCESS
  event = RenderEvent.new(name, Time.now, nil, id, payload)
  push_event(event)

  state = Mmtrix::Agent::TransactionState.tl_get

  if state.is_execution_traced? && event.recordable?
    stack = state.traced_method_stack
    event.frame = stack.push_frame(state, :action_view, event.time)
  end
rescue => e
  log_notification_error(e, name, 'start')
end