Map<String, Long> metricMap = new HashMap<>();
if (stepExecution.getMetrics() != null) {
ColumnFormatter cf = new ColumnFormatter(new String[]{"METRICNAME", "VALUE"});
for (Metric metric : stepExecution.getMetrics()) {
metricMap.put(metric.getType().name(), metric.getValue());
cf.addRow(new Object[] {metric.getType().name(), metric.getValue()});
}
st = new StringTokenizer(cf.toString(), "\n");
}
data = metricMap;
break;