Sha256: 0b462970df96cd355f365291826069f552d5b622e15d707ae831efc7976e1fbc

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
require 'new_relic/agent/instrumentation/active_record_subscriber'

DependencyDetection.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
    !NewRelic::Agent.config[:disable_activerecord_instrumentation] &&
      !NewRelic::Agent::Instrumentation::ActiveRecordSubscriber.subscribed?
  end

  executes do
    ::NewRelic::Agent.logger.info 'Installing ActiveRecord 4+ instrumentation'
  end

  executes do
    ActiveSupport::Notifications.subscribe('sql.active_record',
      NewRelic::Agent::Instrumentation::ActiveRecordSubscriber.new)

    ActiveSupport.on_load(:active_record) do
      ::NewRelic::Agent::Instrumentation::ActiveRecordHelper.instrument_additional_methods
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
newrelic_rpm-3.17.1.326 lib/new_relic/agent/instrumentation/active_record_4.rb
newrelic_rpm-3.17.0.325 lib/new_relic/agent/instrumentation/active_record_4.rb
newrelic_rpm-3.16.3.323 lib/new_relic/agent/instrumentation/active_record_4.rb
newrelic_rpm-3.16.2.321 lib/new_relic/agent/instrumentation/active_record_4.rb
newrelic_rpm-3.16.1.320 lib/new_relic/agent/instrumentation/active_record_4.rb
newrelic_rpm-3.16.0.318 lib/new_relic/agent/instrumentation/active_record_4.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/lib/new_relic/agent/instrumentation/active_record_4.rb
newrelic_rpm-3.15.2.317 lib/new_relic/agent/instrumentation/active_record_4.rb
newrelic_rpm-3.15.1.316 lib/new_relic/agent/instrumentation/active_record_4.rb