public static long getTotalRuntime(List<AppResult> mrJobsList) {
    long lastFinished = 0;
    long firstStarted = Long.MAX_VALUE;

    for (AppResult result : mrJobsList) {
      if (result.finishTime > lastFinished) {
        lastFinished = result.finishTime;
      }
      if (result.startTime < firstStarted) {
        firstStarted = result.startTime;
      }
    }

    return lastFinished - firstStarted;
  }
Returns the total runtime of the job list i.e. last finished job - first started job
@param mrJobsList The total runtime of the job list
@return The total runtime of the job list
app/com/linkedin/drelephant/util/Utils.java