Method: NewRelic::Agent::SqlSampler#on_finishing_transaction

Defined in:
lib/new_relic/agent/sql_sampler.rb

#on_finishing_transaction(state, name) ⇒ Object

This is called when we are done with the transaction.

[View source]

67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/new_relic/agent/sql_sampler.rb', line 67

def on_finishing_transaction(state, name)
  return unless enabled?

  data = state.sql_sampler_transaction_data
  return unless data

  data.set_transaction_name(name)
  if data.sql_data.size > 0
    @samples_lock.synchronize do
      ::NewRelic::Agent.logger.debug("Examining #{data.sql_data.size} slow transaction sql statement(s)")
      save_slow_sql(data)
    end
  end
end