Class: ScoutApm::Instruments::MiddlewareSummary::MiddlewareSummaryWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/scout_apm/instruments/middleware_summary.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ MiddlewareSummaryWrapper

Returns a new instance of MiddlewareSummaryWrapper.



36
37
38
# File 'lib/scout_apm/instruments/middleware_summary.rb', line 36

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/scout_apm/instruments/middleware_summary.rb', line 40

def call(env)
  req = ScoutApm::RequestManager.lookup
  layer = ScoutApm::Layer.new("Middleware", "Summary")
  req.start_layer(layer)
  @app.call(env)
ensure
  req.stop_layer
end