code: protected final long getNumFailedJobs(final List<JobInfo> jobInfos) {
          return jobInfos
                  .stream()
                  .filter(job -> JobStatus.ERROR.equals(job.getStatus()))
                  .count();
      }
docs: Returns the number of failed jobs.
  
  @param jobInfos list of job infos
  @return num failed jobs