def call(env)
      RailsInstrument.reset!
      status, headers, body = @app.call(env)
      begin
        headers["X-View-Runtime"] = (view_runtime / 1000).to_s
        headers["X-DB-Runtime"] = (db_runtime / 1000).to_s
        headers["X-DB-Query-Count"] = sql_count.to_s

        if html_reponse?(headers)
          new_body = Rack::Response.new([], status, headers)
          body.each do |fragment|
            new_body.write fragment.gsub("</body>", "#{sql_html_overlay}</body>")
          end
          body = new_body
        end
      rescue => e
        headers["X-Rails-Instrument"] = "Error"
      end

      [status, headers, body]
    end
def call(env)
      RailsInstrument.reset!
      status, headers, body = @app.call(env)
      begin
        headers["X-View-Runtime"] = (view_runtime / 1000).to_s
        headers["X-DB-Runtime"] = (db_runtime / 1000).to_s
        headers["X-DB-Query-Count"] = sql_count.to_s

        if html_reponse?(headers)
          new_body = Rack::Response.new([], status, headers)
          body.each do |fragment|
            new_body.write fragment.gsub("</body>", "#{sql_html_overlay}</body>")
          end
          body = new_body
        end
      rescue => e
        headers["X-Rails-Instrument"] = "Error"
      end

      [status, headers, body]
    end
:nodoc: