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
Constructor Details
#initialize(app) ⇒ SlowRequestProfiler
Returns a new instance of SlowRequestProfiler.
39 40 41 |
# File 'lib/corn/rack/slow_request_profiler.rb', line 39 def initialize(app) @app = Corn.configured? ? ProfilingApp.new(app) : app end |
Instance Method Details
#call(env) ⇒ Object
43 44 45 |
# File 'lib/corn/rack/slow_request_profiler.rb', line 43 def call(env) @app.call(env) end |
#terminate ⇒ Object
47 48 49 |
# File 'lib/corn/rack/slow_request_profiler.rb', line 47 def terminate @app.terminate if @app.respond_to?(:terminate) end |