Explorar el Código

add metrics for queue operations

Brian Gough hace 6 años
padre
commit
68e12f4d2d
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      services/document-updater/app/coffee/RedisManager.coffee

+ 4 - 1
services/document-updater/app/coffee/RedisManager.coffee

@@ -259,9 +259,11 @@ module.exports = RedisManager =
 					# expire must come after rpush since before it will be a no-op if the list is empty
 					multi.expire keys.docOps(doc_id: doc_id), RedisManager.DOC_OPS_TTL           # index 6
 					if projectHistoryType is "project-history"
-						logger.debug {doc_id}, "skipping push of uncompressed ops for project using project-history"
+						metrics.inc 'history-queue', 1, {status: 'skip-track-changes'}
+						logger.log {doc_id}, "skipping push of uncompressed ops for project using project-history"
 					else
 						# project is using old track-changes history service
+						metrics.inc 'history-queue', 1, {status: 'track-changes'}
 						multi.rpush  historyKeys.uncompressedHistoryOps(doc_id: doc_id), jsonOps...  # index 7
 					# Set the unflushed timestamp to the current time if the doc
 					# hasn't been modified before (the content in mongo has been
@@ -282,6 +284,7 @@ module.exports = RedisManager =
 							docUpdateCount = result[7] # length of uncompressedHistoryOps queue (index 7)
 
 						if jsonOps.length > 0 && Settings.apis?.project_history?.enabled
+							metrics.inc 'history-queue', 1, {status: 'project-history'}
 							ProjectHistoryRedisManager.queueOps project_id, jsonOps..., (error, projectUpdateCount) ->
 								callback null, docUpdateCount, projectUpdateCount
 						else