long endTime = taskExecutionAPIEntity.getEndTime();
public MRJobTaskCountResponse.HistoryTaskCountResponse countHistoryTask(List<org.apache.eagle.jpm.mr.historyentity.TaskExecutionAPIEntity> tasks, long startTimeInMin, long endTimeInMin) { List<MRJobTaskCountResponse.UnitTaskCount> taskCounts = new ArrayList<>(); for (long i = startTimeInMin; i <= endTimeInMin; i++) { taskCounts.add(new MRJobTaskCountResponse.UnitTaskCount(i * DateTimeUtil.ONEMINUTE, null)); } for (org.apache.eagle.jpm.mr.historyentity.TaskExecutionAPIEntity task : tasks) { String taskType = task.getTags().get(MRJobTagName.TASK_TYPE.toString()); long taskStarTimeMin = task.getStartTime() / DateTimeUtil.ONEMINUTE; long taskEndTimeMin = task.getEndTime() / DateTimeUtil.ONEMINUTE; int relativeStartTime = (int) (taskStarTimeMin - startTimeInMin); int relativeEndTime = (int) (taskEndTimeMin - startTimeInMin); for (int i = relativeStartTime; i <= relativeEndTime; i++) { countTask(taskCounts.get(i), taskType); } } MRJobTaskCountResponse.HistoryTaskCountResponse response = new MRJobTaskCountResponse.HistoryTaskCountResponse(); response.taskCount = taskCounts; return response; }
entity.setStartTime(taskStartTime.get(taskID)); entity.setEndTime(Long.valueOf(finishTime)); entity.setDuration(entity.getEndTime() - entity.getStartTime()); entity.setTimestamp(jobLaunchTime); entity.setError(values.get(Keys.ERROR)); entity.setJobCounters(parseCounters(counters)); long duration = entity.getEndTime() - jobLaunchTime; if (taskType.equals(Constants.TaskType.MAP.toString()) && duration > jobExecutionEntity.getLastMapDuration()) { jobExecutionEntity.setLastMapDuration(duration);
mapStartTime = task.getStartTime(); if (mapEndTime < task.getEndTime()) { mapEndTime = task.getEndTime(); reduceStartTime = task.getStartTime(); if (reduceEndTime < task.getEndTime()) { reduceEndTime = task.getEndTime();