Sha256: ec72f01de42e992311fec8c1449fa3af8c255b7d5502f227e81917781fab7b84

Contents?: true

Size: 891 Bytes

Versions: 7

Compression:

Stored size: 891 Bytes

Contents

# encoding: utf-8
require 'ting_yun/instrumentation/support/active_record_subscriber'

TingYun::Support::LibraryDetection.defer do
  named :active_record_5

  depends_on do
    !::TingYun::Agent.config[:disable_active_record]
  end

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

  depends_on do
    !TingYun::Instrumentation::Rails::ActiveRecordSubscriber.subscribed?
  end

  executes do
    ::TingYun::Agent.logger.info 'Installing ActiveRecord 5 instrumentation'
  end

  executes do
    ActiveSupport::Notifications.subscribe('sql.active_record',
                                           TingYun::Instrumentation::Rails::ActiveRecordSubscriber.new)
    ::TingYun::Instrumentation::Support::ActiveRecordHelper.instrument_additional_methods
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tingyun_rpm-3.2.0 lib/ting_yun/instrumentation/rails5/active_record.rb
tingyun_rpm-1.6.1 lib/ting_yun/instrumentation/rails5/active_record.rb
tingyun_rpm-1.5.0 lib/ting_yun/instrumentation/rails5/active_record.rb
tingyun_rpm-1.4.2 lib/ting_yun/instrumentation/rails5/active_record.rb
tingyun_rpm-1.4.1 lib/ting_yun/instrumentation/rails5/active_record.rb
tingyun_rpm-1.3.1 lib/ting_yun/instrumentation/rails5/active_record.rb
tingyun_rpm-1.3.0 lib/ting_yun/instrumentation/rails5/active_record.rb