Module: TestProf::EventProf::CustomEvents::SidekiqInline
- Defined in:
- lib/test_prof/event_prof/custom_events/sidekiq_inline.rb
Overview
:nodoc: all
Defined Under Namespace
Modules: ClientPatch
Class Method Summary collapse
Class Method Details
.setup! ⇒ Object
17 18 19 20 |
# File 'lib/test_prof/event_prof/custom_events/sidekiq_inline.rb', line 17 def setup! @depth = 0 Sidekiq::Client.prepend ClientPatch end |
.track ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/test_prof/event_prof/custom_events/sidekiq_inline.rb', line 22 def track @depth += 1 res = nil begin res = if @depth == 1 ActiveSupport::Notifications.instrument( 'sidekiq.inline' ) { yield } else yield end ensure @depth -= 1 end res end |