mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-23 12:50:50 +00:00
b59326e96f
Use mongo command monitoring to add timing metrics GitOrigin-RevId: e7e5dd5cca1ba3802c02198ccf81058d4da3f1e7
18 lines
426 B
JavaScript
18 lines
426 B
JavaScript
import Metrics from '@overleaf/metrics'
|
|
import Settings from '@overleaf/settings'
|
|
import { MongoClient } from 'mongodb'
|
|
|
|
export { ObjectId } from 'mongodb'
|
|
|
|
export const mongoClient = new MongoClient(
|
|
Settings.mongo.url,
|
|
Settings.mongo.options
|
|
)
|
|
const mongoDb = mongoClient.db()
|
|
|
|
export const db = {
|
|
messages: mongoDb.collection('messages'),
|
|
rooms: mongoDb.collection('rooms'),
|
|
}
|
|
|
|
Metrics.mongodb.monitor(mongoClient)
|