# File lib/new_relic/agent/sql_sampler.rb, line 157 def notice_sql_statement(statement, metric_name, duration) state ||= TransactionState.tl_get data = state.sql_sampler_transaction_data return unless data if state.is_sql_recorded? if duration > Agent.config['slow_sql.explain_threshold''slow_sql.explain_threshold'] backtrace = caller.join("\n") data.sql_data << SlowSql.new(statement, metric_name, duration, backtrace) end end end