Class: ScoutApm::ServerIntegrations::Puma
- Inherits:
-
Object
- Object
- ScoutApm::ServerIntegrations::Puma
- Defined in:
- lib/scout_apm/server_integrations/puma.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #forking? ⇒ Boolean
- #found? ⇒ Boolean
-
#initialize(logger) ⇒ Puma
constructor
A new instance of Puma.
- #install ⇒ Object
- #name ⇒ Object
- #present? ⇒ Boolean
Constructor Details
#initialize(logger) ⇒ Puma
Returns a new instance of Puma.
6 7 8 |
# File 'lib/scout_apm/server_integrations/puma.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/puma.rb', line 4 def logger @logger end |
Instance Method Details
#forking? ⇒ Boolean
14 15 16 17 18 19 20 21 |
# File 'lib/scout_apm/server_integrations/puma.rb', line 14 def forking? return false unless defined?(::Puma) = ::Puma.cli_config.instance_variable_get(:@options) logger.debug .inspect [:preload_app] rescue false end |
#found? ⇒ Boolean
36 37 38 |
# File 'lib/scout_apm/server_integrations/puma.rb', line 36 def found? true end |
#install ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/scout_apm/server_integrations/puma.rb', line 27 def install ::Puma.cli_config.[:before_worker_boot] << Proc.new do logger.debug "Installing Puma worker loop." ScoutApm::Agent.instance.start_background_worker end rescue logger.warn "Unable to install Puma worker loop: #{$!.}" end |
#name ⇒ Object
10 11 12 |
# File 'lib/scout_apm/server_integrations/puma.rb', line 10 def name :puma end |
#present? ⇒ Boolean
23 24 25 |
# File 'lib/scout_apm/server_integrations/puma.rb', line 23 def present? defined?(::Puma) && (File.basename($0) =~ /\Apuma/) end |