Merge pull request #10735 from overleaf/jpa-mongo-connection-pool-stats
[web] collect metrics for mongo connection pool GitOrigin-RevId: 71ca95af4e04f124f5ae12c8967ce85d4d9d0428
This commit is contained in:
@@ -2,6 +2,7 @@ const mongoose = require('mongoose')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const logger = require('@overleaf/logger')
|
||||
const { addConnectionDrainer } = require('./GracefulShutdown')
|
||||
const { collectStatsForDb } = require('./mongodb')
|
||||
|
||||
if (
|
||||
typeof global.beforeEach === 'function' &&
|
||||
@@ -60,6 +61,8 @@ async function getNativeDb() {
|
||||
return mongooseInstance.connection.db
|
||||
}
|
||||
|
||||
getNativeDb().then(db => collectStatsForDb(db, 'mongoose'))
|
||||
|
||||
mongoose.getNativeDb = getNativeDb
|
||||
mongoose.connectionPromise = connectionPromise
|
||||
|
||||
|
||||
Reference in New Issue
Block a user