Class: ScoutApm::Instruments::Typhoeus
- Inherits:
-
Object
- Object
- ScoutApm::Instruments::Typhoeus
show all
- Defined in:
- lib/scout_apm/instruments/typhoeus.rb
Defined Under Namespace
Modules: TyphoeusHydraInstrumentation, TyphoeusInstrumentation
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(context) ⇒ Typhoeus
6
7
8
9
|
# File 'lib/scout_apm/instruments/typhoeus.rb', line 6
def initialize(context)
@context = context
@installed = false
end
|
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
4
5
6
|
# File 'lib/scout_apm/instruments/typhoeus.rb', line 4
def context
@context
end
|
Instance Method Details
#install(prepend:) ⇒ Object
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/scout_apm/instruments/typhoeus.rb', line 19
def install(prepend:)
if defined?(::Typhoeus)
@installed = true
logger.info "Instrumenting Typhoeus"
::Typhoeus::Request.send(:prepend, TyphoeusInstrumentation)
::Typhoeus::Hydra.send(:prepend, TyphoeusHydraInstrumentation)
end
end
|
#installed? ⇒ Boolean
15
16
17
|
# File 'lib/scout_apm/instruments/typhoeus.rb', line 15
def installed?
@installed
end
|
#logger ⇒ Object
11
12
13
|
# File 'lib/scout_apm/instruments/typhoeus.rb', line 11
def logger
context.logger
end
|