mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
74eeec2ba3
Mongo connection pool monitoring GitOrigin-RevId: 050e50e7e67061ccbf39a710ca4532eafd423365
16 lines
536 B
JavaScript
16 lines
536 B
JavaScript
const Metrics = require('@overleaf/metrics')
|
|
|
|
const config = require('config')
|
|
const { MongoClient } = require('mongodb')
|
|
|
|
const client = new MongoClient(config.mongo.uri)
|
|
const db = client.db()
|
|
|
|
const chunks = db.collection('projectHistoryChunks')
|
|
const blobs = db.collection('projectHistoryBlobs')
|
|
const globalBlobs = db.collection('projectHistoryGlobalBlobs')
|
|
const shardedBlobs = db.collection('projectHistoryShardedBlobs')
|
|
|
|
Metrics.mongodb.monitor(client)
|
|
|
|
module.exports = { client, db, chunks, blobs, globalBlobs, shardedBlobs }
|