Class: ActiveSupport::Notifications::NullInstrumenter
| Relationships & Source Files | |
| Namespace Children | |
|
Classes:
| |
| Inherits: | Object |
| Defined in: | activesupport/lib/active_support/notifications/instrumenter.rb |
Overview
A no-op instrumenter that executes blocks without publishing any notifications. Useful for disabling instrumentation on specific connections or components.
This is stateless and thread-safe, so a single instance can be shared.
ActiveSupport::Notifications.null_instrumenter.instrument("sql.active_record") do
# executes without any notification overhead
end
Constant Summary
-
NULL_HANDLE =
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 22NullHandle.new.freeze
Instance Method Summary
Instance Method Details
#build_handle(name, payload)
[ GitHub ]# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 28
def build_handle(name, payload) NULL_HANDLE end
#finish(name, payload)
[ GitHub ]# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 33
def finish(name, payload); end
#instrument(name, payload = {}) {|payload| ... }
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 24
def instrument(name, payload = {}) yield payload if block_given? end
#start(name, payload)
[ GitHub ]# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 32
def start(name, payload); end