Class: NewRelic::Agent::Instrumentation::Praxis::Blueprint::RenderSubscriber

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

Instance Method Summary collapse

Instance Method Details

#finish(name, id, payload) ⇒ Object

THREAD_LOCAL_ACCESS



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/newrelic-praxis/praxis_blueprints/render_subscriber.rb', line 21

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



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/newrelic-praxis/praxis_blueprints/render_subscriber.rb', line 7

def start(name, id, payload) #THREAD_LOCAL_ACCESS
  event = RenderEvent.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_blueprints, event.time)
  end
rescue => e
  log_notification_error(e, name, 'start')
end