class Rack::RubyProf
def call(env)
def call(env) request = Rack::Request.new(env) if should_profile?(request.path) begin result = nil profile = ::RubyProf::Profile.profile(**profiling_options) do result = @app.call(env) end if @merge_fibers profile.merge! end path = request.path.gsub('/', '-') path.slice!(0) print(profile, path) result end else @app.call(env) end end