Module: RailsPerformance::Extensions::Db

Defined in:
lib/rails_performance/extensions/trace.rb

Instance Method Summary collapse

Instance Method Details

#sql(event) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/rails_performance/extensions/trace.rb', line 21

def sql(event)
  CurrentRequest.current.trace({
    group: :db,
    duration: event.duration.round(2),
    sql: event.payload[:sql]
  })
  super(event)
end