Class: Skylight::Probes::NetHTTP::Probe Private
- Defined in:
- lib/skylight/probes/net_http.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Probe for instrumenting Net::HTTP requests. Works by monkeypatching the default Net::HTTP#request method.
Constant Summary collapse
- DISABLED_KEY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
:__skylight_net_http_disabled
Class Method Summary collapse
- .disable ⇒ Object private
- .disabled? ⇒ Boolean private
Instance Method Summary collapse
- #install ⇒ Object private
Class Method Details
.disable ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 37 38 39 40 |
# File 'lib/skylight/probes/net_http.rb', line 34 def self.disable state_was = Thread.current[DISABLED_KEY] Thread.current[DISABLED_KEY] = true yield ensure Thread.current[DISABLED_KEY] = state_was end |
.disabled? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/skylight/probes/net_http.rb', line 42 def self.disabled? !!Thread.current[DISABLED_KEY] end |
Instance Method Details
#install ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
46 47 48 |
# File 'lib/skylight/probes/net_http.rb', line 46 def install Net::HTTP.prepend(Instrumentation) end |