Class: Appsignal::Hooks::PassengerHook

Inherits:
Hook
  • Object
show all
Defined in:
lib/appsignal/hooks/passenger.rb

Instance Method Summary collapse

Methods inherited from Hook

#installed?, register, #try_to_install

Instance Method Details

#dependencies_present?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/appsignal/hooks/passenger.rb', line 6

def dependencies_present?
  defined?(::PhusionPassenger)
end

#installObject


10
11
12
13
14
15
16
17
18
# File 'lib/appsignal/hooks/passenger.rb', line 10

def install
  ::PhusionPassenger.on_event(:starting_worker_process) do |forked|
    Appsignal.forked
  end

  ::PhusionPassenger.on_event(:stopping_worker_process) do
    Appsignal.stop('passenger')
  end
end