You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: middleware.rb
    path of file: ./repos/rails_performance/lib/rails_performance/rails
    
    the code of the file until where you have to start completion: module RailsPerforman
    
      def call!(env)
        @status, @headers, @response = @app.call(env)

        #t = Time.current
        if !RailsPerformance.skip
          if !CurrentRequest.current.ignore.include?(:performance) # grape is executed first, and than ignore regular future storage of "controller"-like request
            if data = CurrentRequest.current.data
              record = RailsPerformance::Models::RequestRecord.new(**data.merge({request_id: CurrentRequest.current.request_id}))

              # for 500 errors
              record.status ||= @status

              # capture referer from where this page was opened
              record.http_referer = env["HTTP_REFERER"] if record.status == 404

              # we can add custom data, for example Http User-Agent
              # or even devise current_user
              if RailsPerformance.custom_data_proc
                # just to be sure it won't break format how we store in redis
                record.custom_data = RailsPerformance.custom_data_proc.call(env)
              end