Module: NetworkResiliency::Adapter::HTTP
Defined Under Namespace
Modules: Instrumentation
Constant Summary collapse
- ID_REGEX =
%r{/[0-9]+(?=/|$)}.freeze
- UUID_REGEX =
%r`/\h{8}-\h{4}-(\h{4})-\h{4}-\h{12}(?=/|$)`.freeze
Instance Method Summary collapse
Instance Method Details
#patch(instance = nil) ⇒ Object
8 9 10 11 12 |
# File 'lib/network_resiliency/adapter/http.rb', line 8 def patch(instance = nil) return if patched?(instance) (instance&.singleton_class || Net::HTTP).prepend(Instrumentation) end |
#patched?(instance = nil) ⇒ Boolean
14 15 16 |
# File 'lib/network_resiliency/adapter/http.rb', line 14 def patched?(instance = nil) (instance&.singleton_class || Net::HTTP).ancestors.include?(Instrumentation) end |