Measure request time in Mongo

How to measure query execution time in MongoDB? I found the Mongo-hacker plugin, but it looks like it measures the request time, including the time it takes all results to be displayed. In PostgreSQL, I am using Explain Analyze SELECT ... but I have not found any time information in mongo db.collection.find ({smth}). Explain ()

+4
source share
2 answers

The easiest way is to set the profiling level in MongoDB: https://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/

As soon as you do this, information about all your requests will be recorded in the system profile table.

+4
source

.explain("executionStats") .

+10

All Articles