java, Calculating mongodb query execution time
-
16-12-2019 - |
Вопрос
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?
Решение
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.
Не связан с StackOverflow