code: private double calculateRate(long cumulative, long currentTime) {
      long timeSinceMapStart = 0;
      assert getPhase() == Phase.MAP : "MapTaskStatus not in map phase!";
  
      long startTime = getStartTime();
      timeSinceMapStart = currentTime - startTime;
      if (timeSinceMapStart <= 0) {
        LOG.error("Current time is " + currentTime + 
            " but start time is " + startTime);
        return 0;
      }
      
      return cumulative/timeSinceMapStart; 
    }
docs: Helper function that calculate the rate, given the total so far and the
  current time
  @param cumulative
  @param currentTime
  @return