Class: AppProfiler::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/app_profiler/middleware.rb,
lib/app_profiler/middleware/base_action.rb,
lib/app_profiler/middleware/view_action.rb,
lib/app_profiler/middleware/upload_action.rb

Defined Under Namespace

Classes: BaseAction, UploadAction, ViewAction

Constant Summary collapse

OTEL_PROFILE_ID =
"profile.id"
OTEL_PROFILE_BACKEND =
"profile.profiler"
OTEL_PROFILE_MODE =
"profile.mode"
OTEL_PROFILE_CONTEXT =
"profile.context"

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



18
19
20
# File 'lib/app_profiler/middleware.rb', line 18

def initialize(app)
  @app = app
end

Instance Method Details

#call(env, params = AppProfiler::RequestParameters.new(Rack::Request.new(env))) ⇒ Object



22
23
24
25
26
# File 'lib/app_profiler/middleware.rb', line 22

def call(env, params = AppProfiler::RequestParameters.new(Rack::Request.new(env)))
  profile(env, params) do
    @app.call(env)
  end
end