Class: Corn::Rack::SlowRequestProfiler

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

Defined Under Namespace

Classes: ProfilingApp

Instance Method Summary collapse

Constructor Details

#initialize(app, *args) ⇒ SlowRequestProfiler

Returns a new instance of SlowRequestProfiler.



37
38
39
# File 'lib/corn/rack/slow_request_profiler.rb', line 37

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

Instance Method Details

#call(env) ⇒ Object



41
42
43
# File 'lib/corn/rack/slow_request_profiler.rb', line 41

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

#terminateObject



45
46
47
# File 'lib/corn/rack/slow_request_profiler.rb', line 45

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