Browse Source

fix(metrics): last invocation time format

ngjaying 5 years atrás
parent
commit
103d2af03a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      xstream/nodes/stats_manager.go

+ 3 - 1
xstream/nodes/stats_manager.go

@@ -80,7 +80,9 @@ func (sm *StatManager) GetMetrics() map[string]interface{} {
 	result[sm.prefix+sm.opId+"_"+strconv.Itoa(sm.instanceId)+"_"+RecordsInTotal] = sm.totalRecordsIn
 	result[sm.prefix+sm.opId+"_"+strconv.Itoa(sm.instanceId)+"_"+RecordsOutTotal] = sm.totalRecordsOut
 	result[sm.prefix+sm.opId+"_"+strconv.Itoa(sm.instanceId)+"_"+ExceptionsTotal] = sm.totalExceptions
-	result[sm.prefix+sm.opId+"_"+strconv.Itoa(sm.instanceId)+"_"+LastInvocation] = sm.lastInvocation.String()
+	if !sm.lastInvocation.IsZero(){
+		result[sm.prefix+sm.opId+"_"+strconv.Itoa(sm.instanceId)+"_"+LastInvocation] = sm.lastInvocation.Format("2006-01-02T15:04:05.999999")
+	}
 	result[sm.prefix+sm.opId+"_"+strconv.Itoa(sm.instanceId)+"_"+ProcessLatencyMs] = sm.processLatency
 
 	return result