Class: ScoutApm::ServerIntegrations::Thin
- Inherits:
-
Object
- Object
- ScoutApm::ServerIntegrations::Thin
- Defined in:
- lib/scout_apm/server_integrations/thin.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #forking? ⇒ Boolean
- #found? ⇒ Boolean
-
#initialize(logger) ⇒ Thin
constructor
A new instance of Thin.
-
#install ⇒ Object
TODO: What does it mean to install on a non-forking env?.
- #name ⇒ Object
- #present? ⇒ Boolean
Constructor Details
#initialize(logger) ⇒ Thin
Returns a new instance of Thin.
6 7 8 |
# File 'lib/scout_apm/server_integrations/thin.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/thin.rb', line 4 def logger @logger end |
Instance Method Details
#forking? ⇒ Boolean
14 |
# File 'lib/scout_apm/server_integrations/thin.rb', line 14 def forking?; false; end |
#found? ⇒ Boolean
39 40 41 |
# File 'lib/scout_apm/server_integrations/thin.rb', line 39 def found? true end |
#install ⇒ Object
TODO: What does it mean to install on a non-forking env?
36 37 |
# File 'lib/scout_apm/server_integrations/thin.rb', line 36 def install end |
#name ⇒ Object
10 11 12 |
# File 'lib/scout_apm/server_integrations/thin.rb', line 10 def name :thin end |
#present? ⇒ Boolean
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/scout_apm/server_integrations/thin.rb', line 16 def present? found_thin = false # This code block detects when thin is run as: # `thin start` if defined?(::Thin) && defined?(::Thin::Server) # Ensure Thin is actually initialized. It could just be required and not running. ObjectSpace.each_object(::Thin::Server) { |x| found_thin = true } end # This code block detects when thin is run as: # `rails server` if defined?(::Rails::Server) ObjectSpace.each_object(::Rails::Server) { |x| found_thin ||= (x.instance_variable_get(:@_server).to_s == "Rack::Handler::Thin") } end found_thin end |