Module: TestProf::EventProf::Instrumentations::ActiveSupport
- Defined in:
- lib/test_prof/event_prof/instrumentations/active_support.rb
Overview
Wrapper over ActiveSupport::Notifications
Class Method Summary collapse
Class Method Details
.instrument(event) ⇒ Object
16 17 18 |
# File 'lib/test_prof/event_prof/instrumentations/active_support.rb', line 16 def instrument(event) ::ActiveSupport::Notifications.instrument(event) { yield } end |
.subscribe(event) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/test_prof/event_prof/instrumentations/active_support.rb', line 8 def subscribe(event) raise ArgumentError, 'Block is required!' unless block_given? ::ActiveSupport::Notifications.subscribe(event) do |_event, start, finish, *_args| yield (finish - start) end end |