mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 04:21:10 +00:00
add metric for pending updates queue
This commit is contained in:
parent
e293d86c14
commit
891fcc696b
1 changed files with 3 additions and 0 deletions
|
@ -5,6 +5,7 @@ Keys = Settings.redis.documentupdater.key_schema
|
||||||
logger = require('logger-sharelatex')
|
logger = require('logger-sharelatex')
|
||||||
os = require "os"
|
os = require "os"
|
||||||
crypto = require "crypto"
|
crypto = require "crypto"
|
||||||
|
metrics = require('./Metrics')
|
||||||
|
|
||||||
HOST = os.hostname()
|
HOST = os.hostname()
|
||||||
RND = crypto.randomBytes(4).toString('hex') # generate a random key for this process
|
RND = crypto.randomBytes(4).toString('hex') # generate a random key for this process
|
||||||
|
@ -27,6 +28,8 @@ module.exports = RealTimeRedisManager =
|
||||||
catch e
|
catch e
|
||||||
return callback e
|
return callback e
|
||||||
updates.push update
|
updates.push update
|
||||||
|
# record metric for updates removed from queue
|
||||||
|
metrics.summary "redis.pendingUpdates", jsonUpdate.length, {status: "pop"}
|
||||||
callback error, updates
|
callback error, updates
|
||||||
|
|
||||||
getUpdatesLength: (doc_id, callback)->
|
getUpdatesLength: (doc_id, callback)->
|
||||||
|
|
Loading…
Reference in a new issue