Class: ScoutApm::ServerIntegrations::Passenger
- Inherits:
-
Object
- Object
- ScoutApm::ServerIntegrations::Passenger
- Defined in:
- lib/scout_apm/server_integrations/passenger.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #forking? ⇒ Boolean
- #found? ⇒ Boolean
-
#initialize(logger) ⇒ Passenger
constructor
A new instance of Passenger.
- #install ⇒ Object
- #name ⇒ Object
- #present? ⇒ Boolean
Constructor Details
#initialize(logger) ⇒ Passenger
Returns a new instance of Passenger.
6 7 8 |
# File 'lib/scout_apm/server_integrations/passenger.rb', line 6 def initialize(logger) @logger = logger end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
4 5 6 |
# File 'lib/scout_apm/server_integrations/passenger.rb', line 4 def logger @logger end |
Instance Method Details
#forking? ⇒ Boolean
14 |
# File 'lib/scout_apm/server_integrations/passenger.rb', line 14 def forking?; true; end |
#found? ⇒ Boolean
36 37 38 |
# File 'lib/scout_apm/server_integrations/passenger.rb', line 36 def found? true end |
#install ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/scout_apm/server_integrations/passenger.rb', line 20 def install logger.info "Installing Passenger worker loop." PhusionPassenger.on_event(:starting_worker_process) do |forked| logger.debug "Passenger is starting a worker process. Starting worker thread." ScoutApm::Agent.instance.start_background_worker end # The agent's at_exit hook doesn't run when a Passenger process stops. # This does run when a process stops. PhusionPassenger.on_event(:stopping_worker_process) do logger.debug "Passenger is stopping a worker process, shutting down the agent." ScoutApm::Agent.instance.shutdown end end |
#name ⇒ Object
10 11 12 |
# File 'lib/scout_apm/server_integrations/passenger.rb', line 10 def name :passenger end |
#present? ⇒ Boolean
16 17 18 |
# File 'lib/scout_apm/server_integrations/passenger.rb', line 16 def present? (defined?(::Passenger) && defined?(::Passenger::AbstractServer)) || defined?(::PhusionPassenger) end |