Class: Corn::Rack::SlowRequestProfiler
- Inherits:
-
Object
- Object
- Corn::Rack::SlowRequestProfiler
- Defined in:
- lib/corn/rack/slow_request_profiler.rb
Defined Under Namespace
Classes: ProfilingApp
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ SlowRequestProfiler
constructor
A new instance of SlowRequestProfiler.
-
#terminate ⇒ Object
for test.
Constructor Details
#initialize(app) ⇒ SlowRequestProfiler
Returns a new instance of SlowRequestProfiler.
43 44 45 46 47 48 49 50 |
# File 'lib/corn/rack/slow_request_profiler.rb', line 43 def initialize(app) @app = if Corn.configured? Corn.logger.info("Corn configuration found, initializing Corn rack middleware") ProfilingApp.new(app) else app end end |
Instance Method Details
#call(env) ⇒ Object
52 53 54 |
# File 'lib/corn/rack/slow_request_profiler.rb', line 52 def call(env) @app.call(env) end |
#terminate ⇒ Object
for test
57 58 59 |
# File 'lib/corn/rack/slow_request_profiler.rb', line 57 def terminate @app.terminate if @app.respond_to?(:terminate) end |