Sha256: b9b30972aee6b7f5d7a3d0ea588408467a184f560a84b3d405d91a3bfabd5b9f

Contents?: true

Size: 1.07 KB

Versions: 16

Compression:

Stored size: 1.07 KB

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative 'concurrent_ruby/instrumentation'
require_relative 'concurrent_ruby/chain'
require_relative 'concurrent_ruby/prepend'

DependencyDetection.defer do
  named :'concurrent_ruby'

  depends_on do
    defined?(Concurrent) &&
      Gem::Version.new(Concurrent::VERSION) >= Gem::Version.new('1.1.5')
  end

  executes do
    NewRelic::Agent.logger.info('Installing concurrent-ruby instrumentation')

    if use_prepend?
      prepend_instrument(Concurrent::ThreadPoolExecutor, NewRelic::Agent::Instrumentation::ConcurrentRuby::Prepend)

      [Concurrent::Promises.const_get(:'InternalStates')::Rejected,
        Concurrent::Promises.const_get(:'InternalStates')::PartiallyRejected].each do |klass|
          klass.prepend(NewRelic::Agent::Instrumentation::ConcurrentRuby::ErrorPrepend)
        end
    else
      chain_instrument NewRelic::Agent::Instrumentation::ConcurrentRuby::Chain
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
newrelic_rpm-9.7.1 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.7.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.6.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.5.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.4.2 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.4.1 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.4.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.3.1 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.3.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.2.2 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.2.1 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.2.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.1.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.0.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-8.16.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-8.15.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb