diff --git a/services/real-time/app/coffee/Router.coffee b/services/real-time/app/coffee/Router.coffee index ad74ebffa1..a7ed73c981 100644 --- a/services/real-time/app/coffee/Router.coffee +++ b/services/real-time/app/coffee/Router.coffee @@ -56,6 +56,7 @@ module.exports = Router = client.emit("connectionAccepted") metrics.inc('socket-io.connection') + metrics.gauge('socket-io.clients', io.sockets.clients()?.length) logger.log session: session, client_id: client.id, "client connected" @@ -77,6 +78,7 @@ module.exports = Router = client.on "disconnect", () -> metrics.inc('socket-io.disconnect') + metrics.gauge('socket-io.clients', io.sockets.clients()?.length - 1) WebsocketController.leaveProject io, client, (err) -> if err? Router._handleError null, err, client, "leaveProject"