@Override public void flush(JobRpcAnalysisAPIEntity entity) { Map<String, Object> fields = new HashMap<>(entity.getTags()); fields.put("trackingUrl", entity.getTrackingUrl()); fields.put("totalOpsPerSecond", entity.getTotalOpsPerSecond()); fields.put("mapOpsPerSecond", entity.getMapOpsPerSecond()); fields.put("reduceOpsPerSecond", entity.getReduceOpsPerSecond()); fields.put("avgOpsPerTask", entity.getAvgOpsPerTask()); fields.put("avgOpsPerMap", entity.getAvgOpsPerMap()); fields.put("avgOpsPerReduce", entity.getAvgOpsPerReduce()); fields.put("currentState", entity.getCurrentState()); fields.put("numTotalMaps", entity.getNumTotalMaps()); fields.put("numTotalReduces", entity.getNumTotalReduces()); fields.put("duration", entity.getDuration()); fields.put("avgMapTime", entity.getAvgMapTime()); fields.put("avgReduceTime", entity.getAvgReduceTime()); collector.collect(stormStreamId, new ValuesArray(fields.get(MRJobTagName.JOB_ID.toString()), fields)); }
tags.put(JOB_TYPE.toString(), entity.getJobType()); tags.put(JOB_ID.toString(), entity.getJobId()); JobRpcAnalysisAPIEntity analysisAPIEntity = new JobRpcAnalysisAPIEntity(); analysisAPIEntity.setTags(tags); analysisAPIEntity.setTimestamp(entity.getStartTime()); analysisAPIEntity.setTrackingUrl(entity.getTrackingUrl()); analysisAPIEntity.setDuration(entity.getDurationTime()); analysisAPIEntity.setNumTotalMaps(entity.getTotalMaps()); analysisAPIEntity.setNumTotalReduces(entity.getTotalReduces()); analysisAPIEntity.setCurrentState(entity.getCurrentState()); analysisAPIEntity.setTotalOpsPerSecond(totalOpsPerSecond); analysisAPIEntity.setMapOpsPerSecond(mapOpsPerSecond); analysisAPIEntity.setReduceOpsPerSecond(reduceOpsPerSecond); analysisAPIEntity.setAvgOpsPerTask(avgOpsPerTask); analysisAPIEntity.setAvgOpsPerMap(avgOpsPerMap); analysisAPIEntity.setAvgOpsPerReduce(avgOpsPerReduce); analysisAPIEntity.setAvgMapTime(avgMapTime); analysisAPIEntity.setAvgReduceTime(avgReduceTime);