mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 04:35:26 -05:00
Merge pull request #45 from sharelatex/bg-record-active-updates-metric
add metric for active workers
This commit is contained in:
commit
95046b1f91
1 changed files with 3 additions and 1 deletions
|
@ -20,7 +20,9 @@ module.exports = DispatchManager =
|
||||||
[list_name, doc_key] = result
|
[list_name, doc_key] = result
|
||||||
[project_id, doc_id] = Keys.splitProjectIdAndDocId(doc_key)
|
[project_id, doc_id] = Keys.splitProjectIdAndDocId(doc_key)
|
||||||
# Dispatch this in the background
|
# Dispatch this in the background
|
||||||
|
Metrics.gauge "processingUpdates", "+1" # increments/decrements gauge with +/- sign
|
||||||
UpdateManager.processOutstandingUpdatesWithLock project_id, doc_id, (error) ->
|
UpdateManager.processOutstandingUpdatesWithLock project_id, doc_id, (error) ->
|
||||||
|
Metrics.gauge "processingUpdates", "-1"
|
||||||
logger.error err: error, project_id: project_id, doc_id: doc_id, "error processing update" if error?
|
logger.error err: error, project_id: project_id, doc_id: doc_id, "error processing update" if error?
|
||||||
callback()
|
callback()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue