mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
b59326e96f
Use mongo command monitoring to add timing metrics GitOrigin-RevId: e7e5dd5cca1ba3802c02198ccf81058d4da3f1e7
18 lines
429 B
JavaScript
18 lines
429 B
JavaScript
const Metrics = require('@overleaf/metrics')
|
|
const Settings = require('@overleaf/settings')
|
|
const { MongoClient, ObjectId } = require('mongodb-legacy')
|
|
|
|
const mongoClient = new MongoClient(Settings.mongo.url, Settings.mongo.options)
|
|
const mongoDb = mongoClient.db()
|
|
|
|
const db = {
|
|
notifications: mongoDb.collection('notifications'),
|
|
}
|
|
|
|
Metrics.mongodb.monitor(mongoClient)
|
|
|
|
module.exports = {
|
|
db,
|
|
mongoClient,
|
|
ObjectId,
|
|
}
|