Module: NewRelic::Agent::Transaction::Pop

Included in:
NewRelic::Agent::Transaction
Defined in:
lib/new_relic/agent/transaction/pop.rb

Instance Method Summary collapse

Instance Method Details

#cpu_burnObject



38
39
40
# File 'lib/new_relic/agent/transaction/pop.rb', line 38

def cpu_burn
  normal_cpu_burn || jruby_cpu_burn
end

#current_stack_metricObject



46
47
48
# File 'lib/new_relic/agent/transaction/pop.rb', line 46

def current_stack_metric
  metric_name
end

#jruby_cpu_burnObject



24
25
26
27
28
29
# File 'lib/new_relic/agent/transaction/pop.rb', line 24

def jruby_cpu_burn
  return unless @jruby_cpu_start
  burn = (jruby_cpu_time - @jruby_cpu_start)
  # record_jruby_cpu_burn(burn)
  burn
end

#log_underflowObject



10
11
12
# File 'lib/new_relic/agent/transaction/pop.rb', line 10

def log_underflow
  ::NewRelic::Agent.logger.error "Underflow in transaction: #{caller.join("\n   ")}"
end

#normal_cpu_burnObject



19
20
21
22
# File 'lib/new_relic/agent/transaction/pop.rb', line 19

def normal_cpu_burn
  return unless @process_cpu_start
  process_cpu - @process_cpu_start
end

#record_jruby_cpu_burn(burn) ⇒ Object

we need to do this here because the normal cpu sampler process doesn’t work on JRuby. See the cpu_sampler.rb file to understand where cpu is recorded for non-jruby processes



34
35
36
# File 'lib/new_relic/agent/transaction/pop.rb', line 34

def record_jruby_cpu_burn(burn)
  NewRelic::Agent.record_metric(NewRelic::Metrics::USER_TIME, burn)
end

#record_transaction_cpuObject



14
15
16
17
# File 'lib/new_relic/agent/transaction/pop.rb', line 14

def record_transaction_cpu
  burn = cpu_burn
  transaction_sampler.notice_transaction_cpu_time(burn) if burn
end

#traced?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/new_relic/agent/transaction/pop.rb', line 42

def traced?
  NewRelic::Agent.is_execution_traced?
end