W3cubDocs

/Ruby on Rails 7.0

class ActionDispatch::MiddlewareStack::InstrumentationProxy

Parent:
Object

This class is used to instrument the execution of a single middleware. It proxies the call method transparently and instruments the method call.

Constants

EVENT_NAME

Public Class Methods

new(middleware, class_name) Show source
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 51
def initialize(middleware, class_name)
  @middleware = middleware

  @payload = {
    middleware: class_name,
  }
end

Public Instance Methods

call(env) Show source
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 59
def call(env)
  ActiveSupport::Notifications.instrument(EVENT_NAME, @payload) do
    @middleware.call(env)
  end
end

© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.