private double getAverageSpillBytes(List<TaskExecutionAPIEntity> tasks) { if (tasks.isEmpty()) { return 0; } long totalSpillBytes = 0; for (TaskExecutionAPIEntity task : tasks) { totalSpillBytes += task.getJobCounters().getCounterValue(JobCounters.CounterName.SPLIT_RAW_BYTES); } return totalSpillBytes / tasks.size(); }
public static double[] getCounterValues(List<TaskExecutionAPIEntity> tasks, JobCounters.CounterName counterName) { List<Double> values = new ArrayList<>(); for (TaskExecutionAPIEntity task : tasks) { values.add(Double.valueOf(task.getJobCounters().getCounterValue(counterName))); } return toArray(values); }
public MRTaskExecutionResponse.TaskDistributionResponse getHistoryTaskDistribution(List<org.apache.eagle.jpm.mr.historyentity.TaskExecutionAPIEntity> tasks, String counterName, String distRange) { MRTaskExecutionResponse.TaskDistributionResponse response = new MRTaskExecutionResponse.TaskDistributionResponse(); response.counterName = counterName; List<Long> distRangeList = ResourceUtils.parseDistributionList(distRange); for (int i = 0; i < distRangeList.size(); i++) { response.taskBuckets.add(new MRTaskExecutionResponse.CountUnit(distRangeList.get(i))); } JobCounters.CounterName jobCounterName = JobCounters.CounterName.valueOf(counterName.toUpperCase()); for (org.apache.eagle.jpm.mr.historyentity.TaskExecutionAPIEntity task : tasks) { Long counterValue = task.getJobCounters().getCounterValue(jobCounterName); int pos = ResourceUtils.getDistributionPosition(distRangeList, counterValue); response.taskBuckets.get(pos).countVal++; } return response; }
public void taskExecutionEntityCreated(TaskExecutionAPIEntity taskExecutionAPIEntity) { JobCounters jobCounters = taskExecutionAPIEntity.getJobCounters(); if (jobCounters == null || jobCounters.getCounters() == null) { LOG.warn("found null job counters, task {}", taskExecutionAPIEntity.getTags().get(MRJobTagName.TASK_ID.toString()));