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: request_started_on_middleware.rb
    path of file: ./repos/manageiq/lib
    
    the code of the file until where you have to start completion: # Add to config/application.rb:
#
#     config.middleware.use 'RequestStartedOnMiddleware'
#
class RequestStartedOnMiddleware
  def initialize(app)
    @app = app
  end

  def call(env)
    start_request(env['PATH_INFO'], Time.zone.now)
    @app.call(env)
    
  def self.long_running_requests
    requests = []
    allowable_request_start_time = long_request.ago

    relevant_thread_list.each do |thread|
      request    = thread[:current_request_path_info]
      started_on = thread[:current_request_started_on]

      # There's a race condition where the complete_request method runs in another
      # thread after we set one or more of the above local variables. The fallout
      # of this is we return a false positive for a request that finished very close
      # to the 2 minute timeout.
      if request.present? && started_on.kind_of?(Time) && started_on < allowable_request_start_time
        duration = (Time.zone.now - started_on).to_f
        requests << [request, duration, thread]
      end
    end