long startTime = taskExecutionAPIEntity.getStartTime(); 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));
if (task.getTags().get(TASK_TYPE.toString()).equalsIgnoreCase(Constants.TaskType.MAP.toString())) { totalMapTime += task.getDuration(); if (mapStartTime > task.getStartTime()) { mapStartTime = task.getStartTime(); if (reduceStartTime > task.getStartTime()) { reduceStartTime = task.getStartTime();