Class: Opera::Operation::Instrumentation
- Inherits:
-
Object
- Object
- Opera::Operation::Instrumentation
- Defined in:
- lib/opera/operation/instrumentation.rb
Defined Under Namespace
Classes: Base
Instance Attribute Summary collapse
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
Instance Method Summary collapse
-
#initialize(operation) ⇒ Instrumentation
constructor
A new instance of Instrumentation.
- #instrument(name:, level: :operation) ⇒ Object
Constructor Details
#initialize(operation) ⇒ Instrumentation
Returns a new instance of Instrumentation.
14 15 16 |
# File 'lib/opera/operation/instrumentation.rb', line 14 def initialize(operation) @operation = operation end |
Instance Attribute Details
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
12 13 14 |
# File 'lib/opera/operation/instrumentation.rb', line 12 def operation @operation end |
Instance Method Details
#instrument(name:, level: :operation) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/opera/operation/instrumentation.rb', line 18 def instrument(name:, level: :operation) return yield if !instrumentation_enabled? return yield if !instrumentation_compatible? instrumentation_class.instrument(operation, name: name, level: level) do yield end end |