class NewRelic::Agent::Tracer::State
This is THE location to store thread local information during a transaction Need a new piece of data? Add a method here, NOT a new thread local variable.
Attributes
Current transaction stack
TT’s and SQL
Execution tracing on current thread
Public Class Methods
Source
# File lib/new_relic/agent/tracer.rb, line 465 def initialize @untraced = [] @current_transaction = nil @record_sql = nil end
Public Instance Methods
Source
# File lib/new_relic/agent/tracer.rb, line 496 def is_execution_traced? @untraced.nil? || @untraced.last != false end
Also aliased as: tracing_enabled?
Source
# File lib/new_relic/agent/tracer.rb, line 505 def is_sql_recorded? @record_sql != false end
Source
# File lib/new_relic/agent/tracer.rb, line 491 def pop_traced # needs else branch coverage @untraced.pop if @untraced # rubocop:disable Style/SafeNavigation end
Source
# File lib/new_relic/agent/tracer.rb, line 487 def push_traced(should_trace) @untraced << should_trace end
Source
# File lib/new_relic/agent/tracer.rb, line 472 def reset(transaction = nil) # We purposefully don't reset @untraced or @record_sql # since those are managed by NewRelic::Agent.disable_* calls explicitly # and (more importantly) outside the scope of a transaction @current_transaction = transaction @sql_sampler_transaction_data = nil end
This starts the timer for the transaction.