module NewRelic::Agent::Instrumentation::ActiveRecordNotifications::BaseExtensions51

Public Instance Methods

log(sql, name = 'SQL', binds = [], type_casted_binds = [], statement_name = nil) { || ... } click to toggle source

github.com/rails/rails/blob/5-1-stable/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L603

# File lib/new_relic/agent/instrumentation/active_record_notifications.rb, line 59
def log(sql, name = 'SQL', binds = [], type_casted_binds = [], statement_name = nil) # :doc:
  @instrumenter.instrument(
    SQL_ACTIVE_RECORD,
    sql: sql,
    name: name,
    binds: binds,
    type_casted_binds: type_casted_binds,
    statement_name: statement_name,
    connection_id: object_id,
    connection: self
  ) do
    @lock.synchronize do
      yield
    end
  end
rescue => e
  raise translate_exception_class(e, sql)
end