Sha256: ad05ebcefd78d5e5030b36fb739a4e2507385bdcdddd089b65b96597bd035534

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

# -*- ruby -*-
# 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 'newrelic_rpm'

DependencyDetection.defer do
  @name = :sequel

  depends_on do
    defined?(::Sequel)
  end

  depends_on do
    !NewRelic::Agent.config[:disable_activerecord_instrumentation] &&
    !NewRelic::Agent.config[:disable_database_instrumentation]
  end

  executes do
    ::NewRelic::Agent.logger.info 'Installing Sequel instrumentation'

    if Sequel::Database.respond_to?( :extension )
      Sequel::Database.extension :newrelic_instrumentation
    else
      NewRelic::Agent.logger.info "Detected Sequel version %s." % [ Sequel::VERSION ]
      NewRelic::Agent.logger.info "Please see additional documentation: " +
        "https://newrelic.com/docs/ruby/sequel-instrumentation"
    end

    Sequel.synchronize{Sequel::DATABASES.dup}.each do |db|
      db.extension :newrelic_instrumentation
    end

    Sequel::Model.plugin :newrelic_instrumentation

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.3.106 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.6.3.105.beta lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.6.3.104 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.6.3.103.beta lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.6.2.96 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.6.2.90.beta lib/new_relic/agent/instrumentation/sequel.rb