mtools
mtools copied to clipboard
Associating getMore commands with the original query
Currently, when running mloginfo --queries, all getmore commands are grouped by collection, even though they may not be associated to the same query.
Finding the query associated with a getmore command can be achieved by comparing the cursor ID.
This way, instead of grouping all getmore commands in a single line, they could actually be grouped by query signature. This would very much improve the output of mloginfo --queries, and provide a much better understanding of the reasons why getmore commands can be slow, at times.
It is important to note that there are a few cases where we cannot associate a getmore with a specific query:
- if the log file was rotated in the middle of a cursor iteration (the query and
getmorecommands would then be in different log files) - if the initial query takes less time than the actual
getmorecommands (this is possible if there are yields when returning the documents with thegetmorecommand).