Format output

This commit is contained in:
Li Zhanhui
2018-05-23 14:20:46 +08:00
parent 0499586eb0
commit c264de9c93
@@ -129,7 +129,11 @@ public class ConsumerProgressSubCommand implements SubCommand {
diffTotal += diff;
String lastTime = "";
try {
lastTime = UtilAll.formatDate(new Date(offsetWrapper.getLastTimestamp()), UtilAll.YYYY_MM_DD_HH_MM_SS);
if (offsetWrapper.getLastTimestamp() == 0) {
lastTime = "N/A";
} else {
lastTime = UtilAll.formatDate(new Date(offsetWrapper.getLastTimestamp()), UtilAll.YYYY_MM_DD_HH_MM_SS);
}
} catch (Exception e) {
}
@@ -144,7 +148,7 @@ public class ConsumerProgressSubCommand implements SubCommand {
mq.getQueueId(),
offsetWrapper.getBrokerOffset(),
offsetWrapper.getConsumerOffset(),
null != clientIP ? clientIP : "NA",
null != clientIP ? clientIP : "N/A",
diff,
lastTime
);