Class: NewRelic::Agent::Instrumentation::Praxis::Mapper::LoadSubscriber

Inherits:
EventedSubscriber
  • Object
show all
Defined in:
lib/newrelic-praxis/praxis_mapper/load_subscriber.rb

Instance Method Summary collapse

Instance Method Details

#finish(name, id, payload) ⇒ Object

THREAD_LOCAL_ACCESS



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/newrelic-praxis/praxis_mapper/load_subscriber.rb', line 23

def finish(name, id, payload) #THREAD_LOCAL_ACCESS
  event = pop_event(id)
  event.payload.merge!(payload)

  state = TransactionState.tl_get

  if state.is_execution_traced?
    stack = state.traced_method_stack
    stack.pop_frame(state, event.frame, event.metric_name, event.end)
  end
rescue => e
  log_notification_error(e, name, 'finish')
end

#start(name, id, payload) ⇒ Object

THREAD_LOCAL_ACCESS



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/newrelic-praxis/praxis_mapper/load_subscriber.rb', line 9

def start(name, id, payload) #THREAD_LOCAL_ACCESS
  event = LoadEvent.new(name, Time.now, nil, id, payload)
  push_event(event)

  state = TransactionState.tl_get

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