Module: HTTPInstrumentation::Instrumentation::EthonHook

Defined in:
lib/http_instrumentation/instrumentation/ethon_hook.rb

Overview

This module is responsible for instrumenting the ethon gem.

Defined Under Namespace

Modules: Easy, Multi

Class Method Summary collapse

Class Method Details

.installed?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
# File 'lib/http_instrumentation/instrumentation/ethon_hook.rb', line 18

def installed?
  !!(
    defined?(::Ethon::Easy) && ::Ethon::Easy.include?(Easy) &&
    defined?(::Ethon::Multi) && ::Ethon::Multi.include?(Multi)
  )
end

.instrument!Object



13
14
15
16
# File 'lib/http_instrumentation/instrumentation/ethon_hook.rb', line 13

def instrument!
  Instrumentation.instrument!(::Ethon::Easy, Easy, [:http_request, :perform]) if defined?(::Ethon::Easy)
  Instrumentation.instrument!(::Ethon::Multi, Multi, :perform) if defined?(::Ethon::Multi)
end