Merge pull request #17268 from overleaf/dp-remove-old-mongo-metrics

Remove timeAsyncMethod mongo metrics

GitOrigin-RevId: 1ba3a1fd51b9d0766355c31791ae9836d832afe8
This commit is contained in:
David
2024-02-29 09:04:19 +00:00
committed by Copybot
parent d08f93c70c
commit 0769329734
15 changed files with 1 additions and 350 deletions
@@ -9,12 +9,10 @@
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
let Notifications
const logger = require('@overleaf/logger')
const { db, ObjectId } = require('./mongodb')
const metrics = require('@overleaf/metrics')
module.exports = Notifications = {
module.exports = {
getUserNotifications(userId, callback) {
if (callback == null) {
callback = function () {}
@@ -132,6 +130,3 @@ module.exports = Notifications = {
db.notifications.deleteOne(searchOps, callback)
},
}
;['getUserNotifications', 'addNotification'].map(method =>
metrics.timeAsyncMethod(Notifications, method, 'mongo.Notifications', logger)
)
@@ -41,7 +41,6 @@ describe('Notifications Tests', function () {
requires: {
'@overleaf/settings': {},
'./mongodb': { db: this.db, ObjectId },
'@overleaf/metrics': { timeAsyncMethod: sinon.stub() },
},
})