Fix client count metric
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
Reference in New Issue
Block a user