Procházet zdrojové kódy

fix(metrics): last invocation time format

ngjaying před 5 roky
rodič
revize
103d2af03a
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  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