rueckstiess / mtools

A collection of scripts to set up MongoDB test environments and parse and visualize MongoDB log files.
Apache License 2.0
1.89k stars 404 forks source link

added query pattern extraction on aggregate operation #862

Open PrasannaSM opened 2 years ago

PrasannaSM commented 2 years ago

Issue 861

Description of changes

Added query pattern extraction on aggregate operation

Testing

Run mloginfo mongo.log --queries whioch contains aggregate operations as well

Result

namespace                  operation    pattern         count    min (ms)    max (ms)    95%-ile (ms)    sum (ms)    mean (ms)    allowDiskUse
test_db.test_coll1         find        {"field1": 1, "field2": 1, "field3": 1, "field4": 1, "field5": 1}          1         470         470           470.0         470        470.0    None
test_db.test_coll2         aggregate         [{"$match": {"field1": 1}}, {"$unwind": 1}, {"$match": {"field2": {"$ne": 1}, "field3": 1, "field4": 1}}, {"$group": {"Count": {"$sum": 1}, "_id": 1}}]         1         252         252           252.0         252        252.0    None
O/S testing: O/S Version(s)
macOS 12.2