From fc84bdf68b9749529d849dd7d4c8e5c3d0c34be3 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 8 Nov 2024 15:23:02 +0000 Subject: [PATCH] Merge pull request #21751 from overleaf/bg-record-background-flush-operations record background flush operations in project-history GitOrigin-RevId: 80169b3f93a844d7162322ca21d605fffc64d687 --- services/project-history/app/js/FlushManager.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/project-history/app/js/FlushManager.js b/services/project-history/app/js/FlushManager.js index 7f8514afc0..8c1870bcb5 100644 --- a/services/project-history/app/js/FlushManager.js +++ b/services/project-history/app/js/FlushManager.js @@ -10,6 +10,7 @@ import async from 'async' import logger from '@overleaf/logger' import OError from '@overleaf/o-error' +import metrics from '@overleaf/metrics' import _ from 'lodash' import * as RedisManager from './RedisManager.js' import * as UpdatesProcessor from './UpdatesProcessor.js' @@ -34,8 +35,10 @@ export function flushIfOld(projectId, cutoffTime, callback) { { projectId, firstOpTimestamp, cutoffTime }, 'flushing old project' ) + metrics.inc('flush-old-updates', 1, { status: 'flushed' }) return UpdatesProcessor.processUpdatesForProject(projectId, callback) } else { + metrics.inc('flush-old-updates', 1, { status: 'skipped' }) return callback() } }