Sha256: c77bdd5e4de9aa8583fe59fc082806bd239f099731947d1a35898176a538edc1

Contents?: true

Size: 1.16 KB

Versions: 46

Compression:

Stored size: 1.16 KB

Contents

# Copyright (c) 2013 AppNeta, Inc.
# All rights reserved.

module TraceView
  module Inst
    module ConnectionAdapters
      module FlavorInitializers
        def self.mysql2
          TraceView.logger.info '[traceview/loading] Instrumenting activerecord mysql2adapter' if TraceView::Config[:verbose]

          TraceView::Util.send_include(::ActiveRecord::ConnectionAdapters::Mysql2Adapter,
                                  ::TraceView::Inst::ConnectionAdapters::Utils)

          if (::ActiveRecord::VERSION::MAJOR == 3 && ::ActiveRecord::VERSION::MINOR == 0) ||
              ::ActiveRecord::VERSION::MAJOR == 2
            # ActiveRecord 3.0 and prior
            TraceView::Util.method_alias(::ActiveRecord::ConnectionAdapters::Mysql2Adapter, :execute)
          else
            # ActiveRecord 3.1 and above
            TraceView::Util.method_alias(::ActiveRecord::ConnectionAdapters::Mysql2Adapter, :exec_insert)
            TraceView::Util.method_alias(::ActiveRecord::ConnectionAdapters::Mysql2Adapter, :exec_query)
            TraceView::Util.method_alias(::ActiveRecord::ConnectionAdapters::Mysql2Adapter, :exec_delete)
          end
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
traceview-3.8.3-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.8.3 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.8.2-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.8.2 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.8.1-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.8.1 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.8.0-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.8.0 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.7.1-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.7.1 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.7.0-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.7.0 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.6.0-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.6.0 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.5.1-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.5.1 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.5.0-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.5.0 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.4.2-java lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb
traceview-3.4.2 lib/traceview/frameworks/rails/inst/connection_adapters/mysql2.rb