Class: ActiveSupport::Notifications::InstrumentationRegistry
- Extended by:
- PerThreadRegistry
- Defined in:
- activesupport/lib/active_support/notifications.rb
Overview
This class is a registry which holds all of the Instrumenter
objects in a particular thread local. To access the Instrumenter
object for a particular notifier
, you can call the following method:
InstrumentationRegistry.instrumenter_for(notifier)
The instrumenters for multiple notifiers are held in a single instance of this class.
Instance Method Summary collapse
-
#initialize ⇒ InstrumentationRegistry
constructor
A new instance of InstrumentationRegistry.
- #instrumenter_for(notifier) ⇒ Object
Methods included from PerThreadRegistry
Constructor Details
#initialize ⇒ InstrumentationRegistry
Returns a new instance of InstrumentationRegistry.
269 270 271 |
# File 'activesupport/lib/active_support/notifications.rb', line 269 def initialize @registry = {} end |
Instance Method Details
#instrumenter_for(notifier) ⇒ Object
273 274 275 |
# File 'activesupport/lib/active_support/notifications.rb', line 273 def instrumenter_for(notifier) @registry[notifier] ||= Instrumenter.new(notifier) end |