add metric for pendingUpdates queue

This commit is contained in:
Brian Gough 2020-04-06 16:24:10 +01:00
parent d4d7f4ed68
commit 5c28da1031
2 changed files with 4 additions and 0 deletions

View file

@ -72,6 +72,9 @@ module.exports = DocumentUpdaterManager =
error.updateSize = updateSize
return callback(error)
# record metric for each update added to queue
metrics.summary 'redis.pendingUpdates', updateSize, {status: 'push'}
doc_key = "#{project_id}:#{doc_id}"
# Push onto pendingUpdates for doc_id first, because once the doc updater
# gets an entry on pending-updates-list, it starts processing.

View file

@ -25,6 +25,7 @@ describe 'DocumentUpdaterManager', ->
'request': @request = {}
'redis-sharelatex' : createClient: () => @rclient
'metrics-sharelatex': @Metrics =
summary: sinon.stub()
Timer: class Timer
done: () ->
globals: