mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 20:34:02 +03:00
Correctly decrease a value for prometheus metrics
This commit is contained in:
+1
-1
@@ -78,7 +78,7 @@ func (p prometheusProcessor) EventFinish(evt mtglib.EventFinish) {
|
|||||||
|
|
||||||
duration := evt.CreatedAt.Sub(sInfo.createdAt)
|
duration := evt.CreatedAt.Sub(sInfo.createdAt)
|
||||||
|
|
||||||
p.factory.metricClientConnections.WithLabelValues(sInfo.GetRemoteIPType()).Dec()
|
p.factory.metricClientConnections.WithLabelValues(sInfo.GetClientIPType()).Dec()
|
||||||
p.factory.metricSessionDuration.Observe(float64(duration) / float64(time.Second))
|
p.factory.metricSessionDuration.Observe(float64(duration) / float64(time.Second))
|
||||||
|
|
||||||
if sInfo.remoteIP == nil {
|
if sInfo.remoteIP == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user