Fix observe for calculateStateDurations

This commit is contained in:
Neil Alexander 2021-07-19 16:30:14 +01:00
parent eb2a8e4c0b
commit 0ad6e37846
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -501,9 +501,8 @@ func (c *calculateStateMetrics) stop(stateNID types.StateSnapshotNID, err error)
} else { } else {
outcome = "failure" outcome = "failure"
} }
endTime := time.Now()
calculateStateDurations.WithLabelValues(c.algorithm, outcome).Observe( calculateStateDurations.WithLabelValues(c.algorithm, outcome).Observe(
float64(endTime.Sub(c.startTime).Nanoseconds()) / 1000., float64(time.Since(c.startTime).Milliseconds()),
) )
calculateStatePrevEventLength.WithLabelValues(c.algorithm, outcome).Observe( calculateStatePrevEventLength.WithLabelValues(c.algorithm, outcome).Observe(
float64(c.prevEventLength), float64(c.prevEventLength),