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

.subscribe(event) ⇒ Object

Raises:

  • (ArgumentError)


7
8
9
10
11
12
13
# File 'lib/test_prof/event_prof/instrumentations/active_support.rb', line 7

def self.subscribe(event)
  raise ArgumentError, 'Block is required!' unless block_given?

  ::ActiveSupport::Notifications.subscribe(event) do |_event, start, finish, *_args|
    yield (finish - start)
  end
end