private ComponentMetric extractMetric(String componentName, Map<String, ?> componentMap) {
Long inputRecords = getLongValueOrDefault(componentMap, STATS_JSON_EXECUTED_TUPLES, 0L);
Long outputRecords = getLongValueOrDefault(componentMap, STATS_JSON_EMITTED_TUPLES, 0L);
Long failedRecords = getLongValueOrDefault(componentMap, STATS_JSON_FAILED_TUPLES, 0L);
Double processedTime = getDoubleValueFromStringOrDefault(componentMap, STATS_JSON_PROCESS_LATENCY, 0.0d);
return new ComponentMetric(StormTopologyUtil.extractStreamlineComponentName(componentName), inputRecords,
outputRecords, failedRecords, processedTime);
}