Question

I want to log my query times for each time when a query made.

I'm using mongodb on playframework. Simply I'm thinkinig to substract start and end time.For ex:

a=currenttime();
madequert();
querytime=currenttime()-a;

Is there any better way?

Was it helpful?

Solution

You probably want to use Mongo's DB profiler. That way you'll keep that of your code (less work to maintain it) and it will give you more options to check Mongo behaviour.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top