Sha256: 974765a9323d199843ee930c1a9aae2406fdbcba2ed1b740365e43f4805e6639

Contents?: true

Size: 1.22 KB

Versions: 17

Compression:

Stored size: 1.22 KB

Contents

# Copyright (c) 2016 SolarWinds, LLC.
# All rights reserved.

module AppOpticsAPM
  module Inst
    module ConnectionAdapters
      module FlavorInitializers
        def self.postgresql

          AppOpticsAPM.logger.info '[appoptics_apm/loading] Instrumenting activerecord postgresqladapter' if AppOpticsAPM::Config[:verbose]

          AppOpticsAPM::Util.send_include(::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter,
                                  ::AppOpticsAPM::Inst::ConnectionAdapters::Utils)

          if (::ActiveRecord::VERSION::MAJOR == 3 && ::ActiveRecord::VERSION::MINOR > 0) ||
                ::ActiveRecord::VERSION::MAJOR >= 4

            # ActiveRecord 3.1 and up
            AppOpticsAPM::Util.method_alias(::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter, :exec_query)
            AppOpticsAPM::Util.method_alias(::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter, :exec_update)
            AppOpticsAPM::Util.method_alias(::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter, :exec_delete)

          else
            # ActiveRecord 3.0 and prior
            AppOpticsAPM::Util.method_alias(::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter, :execute)
          end
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
appoptics_apm-4.4.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.3.1 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.3.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.2.7 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.2.6 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.2.5 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.2.4 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.2.3 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.2.2 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.2.1 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.2.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.1.2 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.0.9 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.1.1 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.0.8 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.1.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.0.7 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb