mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
add metric for project history queue
This commit is contained in:
parent
33ff7f7c1b
commit
e293d86c14
1 changed files with 4 additions and 0 deletions
|
@ -2,9 +2,13 @@ Settings = require('settings-sharelatex')
|
||||||
projectHistoryKeys = Settings.redis?.project_history?.key_schema
|
projectHistoryKeys = Settings.redis?.project_history?.key_schema
|
||||||
rclient = require("redis-sharelatex").createClient(Settings.redis.documentupdater)
|
rclient = require("redis-sharelatex").createClient(Settings.redis.documentupdater)
|
||||||
logger = require('logger-sharelatex')
|
logger = require('logger-sharelatex')
|
||||||
|
metrics = require('./Metrics')
|
||||||
|
|
||||||
module.exports = ProjectHistoryRedisManager =
|
module.exports = ProjectHistoryRedisManager =
|
||||||
queueOps: (project_id, ops..., callback = (error, projectUpdateCount) ->) ->
|
queueOps: (project_id, ops..., callback = (error, projectUpdateCount) ->) ->
|
||||||
|
# Record metric for ops pushed onto queue
|
||||||
|
for op in ops
|
||||||
|
metrics.summary "redis.projectHistoryOps", op.length, {status: "push"}
|
||||||
multi = rclient.multi()
|
multi = rclient.multi()
|
||||||
# Push the ops onto the project history queue
|
# Push the ops onto the project history queue
|
||||||
multi.rpush projectHistoryKeys.projectHistoryOps({project_id}), ops...
|
multi.rpush projectHistoryKeys.projectHistoryOps({project_id}), ops...
|
||||||
|
|
Loading…
Reference in a new issue