Query times in mongoose
See original GitHub issueDo you want to request a feature or report a bug? feature
What is the current behavior? N/A
If the current behavior is a bug, please provide the steps to reproduce. N/A
What is the expected behavior? A way to log the time taken by each mongoose query
Context:
We recently had an issue where our mongo instances were thrashing because we were running a really large and slow query. The size of the query itself was about 5MB and it was taking minutes to execute. I would like to look at each query that we send to mongo and log something if the time taken by the query is above a threshold. The mongoose.('debug', () => {});
only allows to log the query before it’s sent, but no way to find the time taken by the query
Please mention your node.js, mongoose and MongoDB version. node: v8.9.1 mongoose: 4.11.11 mongo: 3.4
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6
Happy to help 🍻