Class: Octopus::AbstractAdapter::OctopusShard::InstrumenterDecorator
- Inherits:
-
ActiveSupport::ProxyObject
- Object
- ActiveSupport::ProxyObject
- Octopus::AbstractAdapter::OctopusShard::InstrumenterDecorator
- Defined in:
- lib/octopus/abstract_adapter.rb
Instance Method Summary collapse
-
#initialize(adapter, instrumenter) ⇒ InstrumenterDecorator
constructor
A new instance of InstrumenterDecorator.
- #instrument(name, payload = {}, &block) ⇒ Object
- #method_missing(meth, *args, &block) ⇒ Object
Constructor Details
#initialize(adapter, instrumenter) ⇒ InstrumenterDecorator
Returns a new instance of InstrumenterDecorator.
6 7 8 9 |
# File 'lib/octopus/abstract_adapter.rb', line 6 def initialize(adapter, instrumenter) @adapter = adapter @instrumenter = instrumenter end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
16 17 18 |
# File 'lib/octopus/abstract_adapter.rb', line 16 def method_missing(meth, *args, &block) @instrumenter.send(meth, *args, &block) end |
Instance Method Details
#instrument(name, payload = {}, &block) ⇒ Object
11 12 13 14 |
# File 'lib/octopus/abstract_adapter.rb', line 11 def instrument(name, payload = {}, &block) payload[:octopus_shard] ||= @adapter.octopus_shard @instrumenter.instrument(name, payload, &block) end |