Skip to Content Skip to Search

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
Methods
B
F
I
S

Constants

NULL_HANDLE = NullHandle.new.freeze
 

Instance Public methods

build_handle(name, payload)

# File activesupport/lib/active_support/notifications/instrumenter.rb, line 28
def build_handle(name, payload)
  NULL_HANDLE
end

finish(name, payload)

# File activesupport/lib/active_support/notifications/instrumenter.rb, line 33
def finish(name, payload); end

instrument(name, payload = {})

# File activesupport/lib/active_support/notifications/instrumenter.rb, line 24
def instrument(name, payload = {})
  yield payload if block_given?
end

start(name, payload)

# File activesupport/lib/active_support/notifications/instrumenter.rb, line 32
def start(name, payload); end