Class: Skylight::Probes::NetHTTP::Probe Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Class Method Details

.disableObject

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.

Returns:

  • (Boolean)


42
43
44
# File 'lib/skylight/probes/net_http.rb', line 42

def self.disabled?
  !!Thread.current[DISABLED_KEY]
end

Instance Method Details

#installObject

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