Parent

Methods

Rack::Profiler

Set the profile=process_time query parameter to download a calltree profile of the request.

Pass the :printer option to pick a different result format.

Public Class Methods

new(app, options = {}) click to toggle source

Accepts a :printer => [:call_tree|:graph_html|:graph|:flat] option defaulting to :call_tree.

# File lib/rack/contrib/profiler.rb, line 30
def initialize(app, options = {})
  @app = app
  @printer = parse_printer(options[:printer])
  @times = (options[:times] || 1).to_i
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack/contrib/profiler.rb, line 36
def call(env)
  if mode = profiling?(env)
    profile(env, mode)
  else
    @app.call(env)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.