mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-27 07:53:53 +00:00
Merge pull request #73 from overleaf/bg-connected-client-metrics
add connected client count metric
This commit is contained in:
commit
022e47b5c8
1 changed files with 2 additions and 0 deletions
|
@ -56,6 +56,7 @@ module.exports = Router =
|
||||||
client.emit("connectionAccepted")
|
client.emit("connectionAccepted")
|
||||||
|
|
||||||
metrics.inc('socket-io.connection')
|
metrics.inc('socket-io.connection')
|
||||||
|
metrics.gauge('socket-io.clients', io.sockets.clients()?.length)
|
||||||
|
|
||||||
logger.log session: session, client_id: client.id, "client connected"
|
logger.log session: session, client_id: client.id, "client connected"
|
||||||
|
|
||||||
|
@ -77,6 +78,7 @@ module.exports = Router =
|
||||||
|
|
||||||
client.on "disconnect", () ->
|
client.on "disconnect", () ->
|
||||||
metrics.inc('socket-io.disconnect')
|
metrics.inc('socket-io.disconnect')
|
||||||
|
metrics.gauge('socket-io.clients', io.sockets.clients()?.length - 1)
|
||||||
WebsocketController.leaveProject io, client, (err) ->
|
WebsocketController.leaveProject io, client, (err) ->
|
||||||
if err?
|
if err?
|
||||||
Router._handleError null, err, client, "leaveProject"
|
Router._handleError null, err, client, "leaveProject"
|
||||||
|
|
Loading…
Reference in a new issue