Sha256: 67ea80cc5252f0e489d374d5fc781095845644ad08d8f718a73ca447d3b0485e

Contents?: true

Size: 702 Bytes

Versions: 3

Compression:

Stored size: 702 Bytes

Contents

if defined?(PhusionPassenger)
  NewRelic::Agent.logger.debug "Installing Passenger event hooks."

  PhusionPassenger.on_event(:stopping_worker_process) do 
    NewRelic::Agent.logger.debug "Passenger stopping this process, shutdown the agent."
    NewRelic::Agent.instance.shutdown
  end

  PhusionPassenger.on_event(:starting_worker_process) do |forked|
    if forked 
      # We want to reset the stats from the stats engine in case any carried
      # over into the spawned process.  Don't clear them in case any were
      # cached.
      NewRelic::Agent.after_fork(:force_reconnect => true)
    else 
      # We're in conservative spawning mode. We don't need to do anything.
    end
  end
  
end 

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newrelic_rpm-2.11.2.beta lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-2.11.1 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-2.11.0.beta2 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb