mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 17:31:37 +00:00
add connected client count metric
This commit is contained in:
parent
49c7bde799
commit
8270c14d86
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
WebsocketController.leaveProject io, client, (err) ->
|
||||
if err?
|
||||
Router._handleError null, err, client, "leaveProject"
|
||||
|
|
Loading…
Reference in a new issue