Fix client count metric
This commit is contained in:
parent
0e792d2416
commit
849d8e0011
@ -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))
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package dogtamer
|
||||
|
||||
import "fmt"
|
||||
|
||||
const Version string = "v0.1.9"
|
||||
const Version string = "v0.1.10"
|
||||
|
||||
var Build string
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user