Class: Corn::Rack::SlowRequestProfiler

Inherits:
Object
  • Object
show all
Includes:
Config
Defined in:
lib/corn/rack/slow_request_profiler.rb

Defined Under Namespace

Classes: ProfilingApp

Instance Method Summary collapse

Methods included from Config

included

Constructor Details

#initialize(app) ⇒ SlowRequestProfiler

Returns a new instance of SlowRequestProfiler.



47
48
49
# File 'lib/corn/rack/slow_request_profiler.rb', line 47

def initialize(app)
  @app = Corn.configured? ? ProfilingApp.new(app, self.class) : app
end

Instance Method Details

#call(env) ⇒ Object



51
52
53
# File 'lib/corn/rack/slow_request_profiler.rb', line 51

def call(env)
  @app.call(env)
end

#terminateObject



55
56
57
# File 'lib/corn/rack/slow_request_profiler.rb', line 55

def terminate
  @app.terminate if @app.respond_to?(:terminate)
end