Sha256: fc906adc3d67f9efda09161baab88a2133ab31a762d736cac4f615a96880ccf9

Contents?: true

Size: 566 Bytes

Versions: 7

Compression:

Stored size: 566 Bytes

Contents

DependencyDetection.defer do
  depends_on do
    defined?(::Unicorn) && defined?(::Unicorn::HttpServer)
  end
  
  executes do
    NewRelic::Agent.logger.debug 'Installing Unicorn instrumentation'
  end
  
  executes do
    Unicorn::HttpServer.class_eval do
      NewRelic::Agent.logger.debug "Installing Unicorn worker hook."
      old_worker_loop = instance_method(:worker_loop)
      define_method(:worker_loop) do | worker |
        NewRelic::Agent.after_fork(:force_reconnect => true)
        old_worker_loop.bind(self).call(worker)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-3.1.2 lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
newrelic_rpm-3.1.2.beta2 lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
newrelic_rpm-3.1.2.beta1 lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
newrelic_rpm-3.1.1 lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
newrelic_rpm-3.1.1.beta3 lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
newrelic_rpm-3.1.1.beta2 lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
newrelic_rpm-3.1.1.beta1 lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb