From 891fcc696bcef5d5606dd4086d041eb55c3ccff0 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Wed, 25 Mar 2020 12:15:35 +0000 Subject: [PATCH] add metric for pending updates queue --- .../document-updater/app/coffee/RealTimeRedisManager.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/document-updater/app/coffee/RealTimeRedisManager.coffee b/services/document-updater/app/coffee/RealTimeRedisManager.coffee index d04f2304d3..6fd48033da 100644 --- a/services/document-updater/app/coffee/RealTimeRedisManager.coffee +++ b/services/document-updater/app/coffee/RealTimeRedisManager.coffee @@ -5,6 +5,7 @@ Keys = Settings.redis.documentupdater.key_schema logger = require('logger-sharelatex') os = require "os" crypto = require "crypto" +metrics = require('./Metrics') HOST = os.hostname() RND = crypto.randomBytes(4).toString('hex') # generate a random key for this process @@ -27,6 +28,8 @@ module.exports = RealTimeRedisManager = catch e return callback e updates.push update + # record metric for updates removed from queue + metrics.summary "redis.pendingUpdates", jsonUpdate.length, {status: "pop"} callback error, updates getUpdatesLength: (doc_id, callback)->