Sha256: c22db6c6e887c5d202857b8dede25bb78fc20327ffc3b8a61fdbfb6b253e9eae

Contents?: true

Size: 426 Bytes

Versions: 7

Compression:

Stored size: 426 Bytes

Contents

module SystemMetrics
  module Instrument
    class ActiveRecord < SystemMetrics::Instrument::Base

      def initialize
        super /\.active_record$/
      end

      def ignore?(event)
        event.payload[:sql] !~ /^(SELECT|INSERT|UPDATE|DELETE)/
      end

      def prepare(event)
        event.payload[:sql] = event.payload[:sql].squeeze(" ")
        event.payload.delete(:connection_id)
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
system-metrics-0.2.5 lib/system_metrics/instrument/active_record.rb
system-metrics-0.2.4 lib/system_metrics/instrument/active_record.rb
system-metrics-0.2.3 lib/system_metrics/instrument/active_record.rb
system-metrics-0.2.2 lib/system_metrics/instrument/active_record.rb
system-metrics-0.2.1 lib/system_metrics/instrument/active_record.rb
system-metrics-0.2.0 lib/system_metrics/instrument/active_record.rb
system-metrics-0.1.0 lib/system_metrics/instrument/active_record.rb