Sha256: 402b771ca734ed6d8f365438f04b017733c4539293151539efdf1c755cb7f620

Contents?: true

Size: 1.2 KB

Versions: 22

Compression:

Stored size: 1.2 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

22 entries across 22 versions & 2 rubygems

Version Path
appoptics_apm-4.13.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.12.2 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.12.1 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.12.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.11.2 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.11.1 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.11.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.10.1 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.10.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.9.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.8.4 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.8.3 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.8.2 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.8.1 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.8.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.7.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.6.0 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm_mnfst-4.5.2 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.5.2 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb
appoptics_apm-4.5.1 lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb