/** * getBoltOutputStats. * @param streamId streamId * @param componentAggregateStats componentAggregateStats * @return getBoltOutputStats */ private static Map<String, Object> getBoltOutputStats(String streamId, ComponentAggregateStats componentAggregateStats) { Map<String, Object> result = new HashMap(); result.put("stream", streamId); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.put("emitted", nullToZero(commonStats.get_emitted())); result.put("transferred", nullToZero(commonStats.get_transferred())); return result; }
public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE: return get_type(); case COMMON_STATS: return get_common_stats(); case SPECIFIC_STATS: return get_specific_stats(); case LAST_ERROR: return get_last_error(); } throw new java.lang.IllegalStateException(); }
/** * getTopologySpoutAggStatsMap. * @param componentAggregateStats componentAggregateStats * @param spoutId spoutId * @return getTopologySpoutAggStatsMap */ private static Map<String, Object> getTopologySpoutAggStatsMap(ComponentAggregateStats componentAggregateStats, String spoutId) { Map<String, Object> result = new HashMap(); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.putAll(getCommonAggStatsMap(commonStats)); result.put("spoutId", spoutId); result.put("encodedSpoutId", URLEncoder.encode(spoutId)); SpoutAggregateStats spoutAggregateStats = componentAggregateStats.get_specific_stats().get_spout(); result.put("completeLatency", spoutAggregateStats.get_complete_latency_ms()); ErrorInfo lastError = componentAggregateStats.get_last_error(); result.put("lastError", Objects.isNull(lastError) ? "" : getTruncatedErrorString(lastError.get_error())); return result; }
/** * getSpoutAggStatsMap. * @param componentAggregateStats componentAggregateStats * @param window window * @return getSpoutAggStatsMap */ private static Map<String, Object> getSpoutAggStatsMap( ComponentAggregateStats componentAggregateStats, String window) { Map<String, Object> result = new HashMap(); SpoutAggregateStats spoutAggregateStats = componentAggregateStats.get_specific_stats().get_spout(); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.put("window", window); result.put("windowPretty", getWindowHint(window)); result.put("emitted", commonStats.get_emitted()); result.put("transferred", commonStats.get_transferred()); result.put("acked", commonStats.get_acked()); result.put("failed", commonStats.get_failed()); result.put("completeLatency", spoutAggregateStats.get_complete_latency_ms()); ErrorInfo lastError = componentAggregateStats.get_last_error(); result.put("lastError", Objects.isNull(lastError) ? "" : getTruncatedErrorString(lastError.get_error())); return result; }
/** * getTopologyBoltAggStatsMap. * @param componentAggregateStats componentAggregateStats * @param boltId boltId * @return getTopologyBoltAggStatsMap */ private static Map<String, Object> getTopologyBoltAggStatsMap(ComponentAggregateStats componentAggregateStats, String boltId) { Map<String, Object> result = new HashMap(); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.putAll(getCommonAggStatsMap(commonStats)); result.put("boltId", boltId); result.put("encodedBoltId", URLEncoder.encode(boltId)); BoltAggregateStats boltAggregateStats = componentAggregateStats.get_specific_stats().get_bolt(); result.put("capacity", StatsUtil.floatStr(boltAggregateStats.get_capacity())); result.put("executeLatency", StatsUtil.floatStr(boltAggregateStats.get_execute_latency_ms())); result.put("executed", boltAggregateStats.get_executed()); result.put("processLatency", StatsUtil.floatStr(boltAggregateStats.get_process_latency_ms())); ErrorInfo lastError = componentAggregateStats.get_last_error(); result.put("lastError", Objects.isNull(lastError) ? "" : getTruncatedErrorString(lastError.get_error())); return result; }
/** * getBoltAggStatsMap. * @param componentAggregateStats componentAggregateStats * @param window window * @return getBoltAggStatsMap */ private static Map<String, Object> getBoltAggStatsMap( ComponentAggregateStats componentAggregateStats, String window) { Map<String, Object> result = new HashMap(); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.put("window", window); result.put("windowPretty", getWindowHint(window)); result.put("emitted", commonStats.get_emitted()); result.put("transferred", commonStats.get_transferred()); result.put("acked", commonStats.get_acked()); result.put("failed", commonStats.get_failed()); BoltAggregateStats boltAggregateStats = componentAggregateStats.get_specific_stats().get_bolt(); result.put("executeLatency", StatsUtil.floatStr(boltAggregateStats.get_execute_latency_ms())); result.put("executed", boltAggregateStats.get_executed()); result.put("processLatency", StatsUtil.floatStr(boltAggregateStats.get_process_latency_ms())); result.put("capacity", StatsUtil.floatStr(boltAggregateStats.get_capacity())); return result; }
/** * getSpoutOutputStats. * @param streamId streamId * @param componentAggregateStats componentAggregateStats * @return getSpoutOutputStats */ private static Map<String, Object> getSpoutOutputStats(String streamId, ComponentAggregateStats componentAggregateStats) { SpecificAggregateStats specificAggregateStats = componentAggregateStats.get_specific_stats(); SpoutAggregateStats spoutAggregateStats = specificAggregateStats.get_spout(); Map<String, Object> result = new HashMap(); result.put("stream", streamId); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.put("emitted", nullToZero(commonStats.get_emitted())); result.put("transferred", nullToZero(commonStats.get_transferred())); result.put("completeLatency", StatsUtil.floatStr(spoutAggregateStats.get_complete_latency_ms())); result.put("acked", nullToZero(commonStats.get_acked())); result.put("failed", nullToZero(commonStats.get_failed())); return result; }
/** * getBoltInputStats. * @param globalStreamId globalStreamId * @param componentAggregateStats componentAggregateStats * @return getBoltInputStats */ private static Map<String, Object> getBoltInputStats(GlobalStreamId globalStreamId, ComponentAggregateStats componentAggregateStats) { Map<String, Object> result = new HashMap(); SpecificAggregateStats specificAggregateStats = componentAggregateStats.get_specific_stats(); BoltAggregateStats boltAggregateStats = specificAggregateStats.get_bolt(); CommonAggregateStats commonAggregateStats = componentAggregateStats.get_common_stats(); String componentId = globalStreamId.get_componentId(); result.put("component", componentId); result.put("encodedComponentId", URLEncoder.encode(componentId)); result.put("stream", globalStreamId.get_streamId()); result.put("executeLatency", StatsUtil.floatStr(boltAggregateStats.get_execute_latency_ms())); result.put("processLatency", StatsUtil.floatStr(boltAggregateStats.get_process_latency_ms())); result.put("executed", nullToZero(boltAggregateStats.get_executed())); result.put("acked", nullToZero(commonAggregateStats.get_acked())); result.put("failed", nullToZero(commonAggregateStats.get_failed())); return result; }
SpecificAggregateStats specificAggregateStats = componentAggregateStats.get_specific_stats(); SpoutAggregateStats spoutAggregateStats = specificAggregateStats.get_spout(); CommonAggregateStats commonAggregateStats = componentAggregateStats.get_common_stats(); String executorId = prettyExecutorInfo(executorInfo); result.put("id", executorId);
SpecificAggregateStats specificAggregateStats = componentAggregateStats.get_specific_stats(); BoltAggregateStats boltAggregateStats = specificAggregateStats.get_bolt(); CommonAggregateStats commonAggregateStats = componentAggregateStats.get_common_stats(); String executorId = prettyExecutorInfo(executorInfo); result.put("id", executorId);
CommonAggregateStats commonStats = entry.getValue().get_common_stats(); setResourcesDefaultIfNotSet(spoutResources, entry.getKey(), topoConf); commonStats.set_resources_map(spoutResources.get(entry.getKey()).toNormalizedMap()); CommonAggregateStats commonStats = entry.getValue().get_common_stats(); setResourcesDefaultIfNotSet(boltResources, entry.getKey(), topoConf); commonStats.set_resources_map(boltResources.get(entry.getKey()).toNormalizedMap());
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return get_type(); case COMMON_STATS: return get_common_stats(); case SPECIFIC_STATS: return get_specific_stats(); case LAST_ERROR: return get_last_error(); } throw new IllegalStateException(); }