mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-04 16:16:37 +00:00
add a per-client metric
This commit is contained in:
parent
cb289f2dec
commit
999cbd8ee6
1 changed files with 4 additions and 1 deletions
|
@ -14,12 +14,15 @@ module.exports = DocumentUpdaterController =
|
|||
rclientList: RedisClientManager.createClientList(settings.redis.pubsub, settings.redis.unusedpubsub)
|
||||
|
||||
listenForUpdatesFromDocumentUpdater: (io) ->
|
||||
for rclient in @rclientList
|
||||
for rclient, i in @rclientList
|
||||
rclient.subscribe "applied-ops"
|
||||
rclient.on "message", (channel, message) ->
|
||||
metrics.inc "rclient", 0.001 # global event rate metric
|
||||
EventLogger.debugEvent(channel, message) if settings.debugEvents > 0
|
||||
DocumentUpdaterController._processMessageFromDocumentUpdater(io, channel, message)
|
||||
do (i) ->
|
||||
rclient.on "message", () ->
|
||||
metrics.inc "rclient-#{i}", 0.001 # per client event rate metric
|
||||
|
||||
_processMessageFromDocumentUpdater: (io, channel, message) ->
|
||||
SafeJsonParse.parse message, (error, message) ->
|
||||
|
|
Loading…
Reference in a new issue