You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running mloginfo on a mongo log file with --queries option returns None as pattern for aggregate operation.
The property definition is as follows
@property
def pattern(self):
"""Extract query pattern from operations."""
if not self._pattern:
# trigger evaluation of operation
if (self.operation in ['query', 'getmore', 'update', 'remove'] or
self.command in ['count', 'findandmodify']):
self._pattern = self._find_pattern('query: ')
# Fallback check for q: variation (eg "remove" command in 3.6+)
if self._pattern is None:
self._pattern = self._find_pattern('q: ')
elif self.command == 'find':
self._pattern = self._find_pattern('filter: ')
return self._pattern
There is no case for handling aggregate command in the above snippet. This behavior of mloginfo restricts the context of having a common place where the complete summary (in table form) would be available.
I looked into this previously and unfortunately logged aggregation pipelines didn't seem well suited for a concise summary of query patterns being executed per #338 (comment). This comment also includes some suggestions on how to investigate slow aggregation queries.
It was intentional to use None for the aggregation pattern as output becomes extremely difficult to reduce & read with longer aggregations.
I get where you're coming from. In that case, can't we provide arg support to show aggregate pattern mloginfo mongo.log --queries --show-aggregate-pattern
Only if --show-aggregate-pattern is provided, we would display pattern. otherwise, it will be morphed as None (current behavior)
Readability issue can be addressed if user can write it to a file instead of viewing a table
Running mloginfo on a mongo log file with
--queries
option returnsNone
as pattern for aggregate operation.The property definition is as follows
There is no case for handling
aggregate
command in the above snippet. This behavior of mloginfo restricts the context of having a common place where the complete summary (in table form) would be available.Expected behavior
Actual/current behavior
The text was updated successfully, but these errors were encountered: