Sha256: 454a2746cb63d55f405928d779c4deef3c8f5b13a7a8ef66bbbca404995e4826

Contents?: true

Size: 715 Bytes

Versions: 5

Compression:

Stored size: 715 Bytes

Contents

if defined?(PhusionPassenger)
  NewRelic::Control.instance.log.debug "Installing Passenger event hooks."

  PhusionPassenger.on_event(:stopping_worker_process) do 
    NewRelic::Control.instance.log.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.instance.stats_engine.reset_stats
    else 
      # We're in conservative spawning mode. We don't need to do anything.
    end
  end
  
end 

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
newrelic_rpm-2.10.8 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-2.10.6 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-2.10.5 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-2.10.4 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-2.10.3 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb