Sha256: 384d8048e59af51910feb3bac834fbf6fa5e07b244479ba43e8b45829233a8c7

Contents?: true

Size: 728 Bytes

Versions: 26

Compression:

Stored size: 728 Bytes

Contents

# encoding: utf-8

require 'one_apm/inst/rails4/active_record_subscriber'

LibraryDetection.defer do
  named :active_record_4

  depends_on do
    defined?(::ActiveRecord) &&
    defined?(::ActiveRecord::Base) &&
    defined?(::ActiveRecord::VERSION) &&
    ::ActiveRecord::VERSION::MAJOR.to_i >= 4
  end

  depends_on do
    !OneApm::Manager.config[:disable_activerecord] &&
    !OneApm::Agent::Instrumentation::ActiveRecordSubscriber.subscribed?
  end

  executes do
    OneApm::Manager.logger.info 'Installing ActiveRecord 4 instrumentation'
  end

  executes do
    subscriber = OneApm::Agent::Instrumentation::ActiveRecordSubscriber.new
    ActiveSupport::Notifications.subscribe('sql.active_record', subscriber)
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
oneapm_rpm-1.2.2 lib/one_apm/inst/orm/active_record_4.rb
oneapm_rpm-1.2.2.rc lib/one_apm/inst/orm/active_record_4.rb
oneapm_rpm-1.2.1 lib/one_apm/inst/orm/active_record_4.rb
oneapm_rpm-1.2.1.rc lib/one_apm/inst/orm/active_record_4.rb
oneapm_rpm-1.2.0 lib/one_apm/inst/orm/active_record_4.rb
oneapm_rpm-1.1.3 lib/one_apm/inst/orm/active_record_4.rb