mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02:00
Merge pull request #73 from overleaf/bg-connected-client-metrics
add connected client count metric
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user