Sha256: 2eb5ddec2faee6b84009de7b14f4e84757671e81da22fbea63db11235093a170

Contents?: true

Size: 659 Bytes

Versions: 2

Compression:

Stored size: 659 Bytes

Contents

module Airbrake
  module Rails
    # ActiveRecordSubscriber sends SQL information, including performance data.
    #
    # @since v8.1.0
    class ActiveRecordSubscriber
      def initialize(notifier)
        @notifier = notifier
      end

      def call(*args)
        event = ActiveSupport::Notifications::Event.new(*args)
        @notifier.notify(
          Airbrake::Query.new(
            route: Thread.current[:airbrake_rails_route],
            method: Thread.current[:airbrake_rails_method],
            query: event.payload[:sql],
            start_time: event.time,
            end_time: event.end
          )
        )
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
airbrake-8.1.1 lib/airbrake/rails/active_record_subscriber.rb
airbrake-8.1.0 lib/airbrake/rails/active_record_subscriber.rb