Class: ScoutApm::Instruments::Grape
- Inherits:
-
Object
- Object
- ScoutApm::Instruments::Grape
- Defined in:
- lib/scout_apm/instruments/grape.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #initalize(logger = ScoutApm::Agent.instance.logger) ⇒ Object
- #install ⇒ Object
- #installed? ⇒ Boolean
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
4 5 6 |
# File 'lib/scout_apm/instruments/grape.rb', line 4 def logger @logger end |
Instance Method Details
#initalize(logger = ScoutApm::Agent.instance.logger) ⇒ Object
6 7 8 9 |
# File 'lib/scout_apm/instruments/grape.rb', line 6 def initalize(logger=ScoutApm::Agent.instance.logger) @logger = logger @installed = false end |
#install ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/scout_apm/instruments/grape.rb', line 15 def install @installed = true if defined?(::Grape) && defined?(::Grape::Endpoint) ScoutApm::Agent.instance.logger.info "Instrumenting Grape::Endpoint" ::Grape::Endpoint.class_eval do include ScoutApm::Instruments::GrapeEndpointInstruments alias run_without_scout_instruments run alias run run_with_scout_instruments end end end |
#installed? ⇒ Boolean
11 12 13 |
# File 'lib/scout_apm/instruments/grape.rb', line 11 def installed? @installed end |