Sha256: c7165e532a75509ac32480b43b3218467af0c43136202a53fcc46b2d4b6f383b

Contents?: true

Size: 769 Bytes

Versions: 3

Compression:

Stored size: 769 Bytes

Contents

# encoding: utf-8

LibraryDetection.defer do
  @name = :passenger

  depends_on do
    defined?(::PhusionPassenger)
  end

  executes do
    ::OneApm::Agent.logger.debug "Installing Passenger event hooks."

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

    ::PhusionPassenger.on_event(:starting_worker_process) do |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.  We do this even in conservative spawning.
      OneApm::Agent.instance.after_fork(:force_reconnect => true)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
oneapm_rpm-1.1.2 lib/one_apm/inst/dispatcher/passenger.rb
oneapm_rpm-1.1.1 lib/one_apm/inst/dispatcher/passenger.rb
oneapm_rpm-1.1.0 lib/one_apm/inst/dispatcher/passenger.rb