class SystemMetrics::Instrument::ActiveRecord

Public Class Methods

new() click to toggle source
Calls superclass method SystemMetrics::Instrument::Base::new
# File lib/system_metrics/instrument/active_record.rb, line 5
def initialize
  super /\.active_record$/
end

Public Instance Methods

ignore?(event) click to toggle source
# File lib/system_metrics/instrument/active_record.rb, line 9
def ignore?(event)
  event.payload[:sql] !~ /^(SELECT|INSERT|UPDATE|DELETE)/
end
prepare(event) click to toggle source
# File lib/system_metrics/instrument/active_record.rb, line 13
def prepare(event)
  event.payload[:sql] = event.payload[:sql].squeeze(" ")
  event.payload.delete(:connection_id)
end