Commit 00e57836 authored by Miklós Tóth's avatar Miklós Tóth 🤷
Browse files

Add active connections gauge

parent 0dc70bf6
Pipeline #8895 passed with stages
in 1 minute and 9 seconds
......@@ -16,3 +16,9 @@ var Votes = promauto.NewCounter(prometheus.CounterOpts{
Name: "votes",
Help: "number of votes counted",
})
var ActiveConnections = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "matrix",
Name: "active",
Help: "number of votes counted",
})
......@@ -30,6 +30,8 @@ func broadcast(start bool) {
var socketsByTeams = make(map[string][]sockjs.Session)
func socketHandler(session sockjs.Session) {
go metrics.ActiveConnections.Inc()
defer metrics.ActiveConnections.Dec()
connectedSockets = append(connectedSockets, session)
e := sendMsg(session, &resp{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment