From 849d8e001110de4ea732461944cc3f3f1374e8b4 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 1 Nov 2021 21:57:13 +0100 Subject: [PATCH] Fix client count metric --- server/rtmp.go | 4 ++-- version.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/rtmp.go b/server/rtmp.go index ed533af..150c9eb 100644 --- a/server/rtmp.go +++ b/server/rtmp.go @@ -346,12 +346,11 @@ func (rs *RTMPServer) EnableMetrics() { }, ) prometheus.MustRegister(currentStreams) - currentClients := prometheus.NewGaugeVec( + currentClients := prometheus.NewGauge( prometheus.GaugeOpts{ Name: "dogtamer_current_clients", Help: "Currently connected clients.", }, - []string{"stream_name"}, ) prometheus.MustRegister(currentClients) bytesReceived := prometheus.NewGaugeVec( @@ -402,6 +401,7 @@ func (rs *RTMPServer) EnableMetrics() { } } rs.streamsLock.RUnlock() + currentClients.Set(float64(clientCount)) } }() } diff --git a/version.go b/version.go index 638e7b5..04aaf7e 100644 --- a/version.go +++ b/version.go @@ -2,7 +2,7 @@ package dogtamer import "fmt" -const Version string = "v0.1.9" +const Version string = "v0.1.10" var Build string