Module: BusinessFlow::Instrument::ClassMethods
- Defined in:
- lib/business_flow/instrument.rb
Overview
Contains methods that we add to the DSL
Constant Summary collapse
- INSTRUMENTATION_PREFIX =
'business_flow'.freeze
Instance Method Summary collapse
- #event_name ⇒ Object
- #instrument(name, flow) ⇒ Object
- #instrument_steps ⇒ Object
- #instrumentation_name ⇒ Object
Instance Method Details
#event_name ⇒ Object
34 35 36 37 |
# File 'lib/business_flow/instrument.rb', line 34 def event_name @event_name ||= "#{INSTRUMENTATION_PREFIX}.flow.#{instrumentation_name}".freeze end |
#instrument(name, flow) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/business_flow/instrument.rb', line 16 def instrument(name, flow) payload = { flow: flow } ActiveSupport::Notifications.instrument( "#{INSTRUMENTATION_PREFIX}.#{name}.#{instrumentation_name}", payload ) do yield payload end end |
#instrument_steps ⇒ Object
25 26 27 |
# File 'lib/business_flow/instrument.rb', line 25 def instrument_steps step_executor ::BusinessFlow::InstrumentedStepExecutor end |
#instrumentation_name ⇒ Object
29 30 31 32 |
# File 'lib/business_flow/instrument.rb', line 29 def instrumentation_name @instrumentation_name ||= to_s.underscore.freeze end |