Mongometer
MongoDB aggregation pipeline performance checker
Install / Use
/learn @roman-right/MongometerREADME
MongoMeter
MongoDB aggregation pipeline performance checker
Install
pip install mongometer
Console
Example
Input
mongometer --url="mongodb://test:test@localhost:27017" --db=shop --collection bikes --path agg.json
Output
Processing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$match ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$set ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$match ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$lookup ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$unwind ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$unwind ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$project ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$sort ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$facet ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
$set ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Results
┏━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Name ┃ Time (seconds) ┃
┡━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1 │ $match │ 1.5710415840148926 │
│ 2 │ $set │ 0.0 │
│ 3 │ $match │ 0.0 │
│ 4 │ $lookup │ 0.00015425682067871094 │
│ 5 │ $unwind │ 0.0014383792877197266 │
│ 6 │ $unwind │ 0.003248453140258789 │
│ 7 │ $project │ 0.06569337844848633 │
│ 8 │ $sort │ 3.276400566101074 │
│ 9 │ $facet │ 0.5028722286224365 │
│ 10 │ $set │ 0.0 │
└────┴──────────┴────────────────────────┘
Parameters
Usage: mongometer [OPTIONS]
Options:
--url TEXT MongoDB connection string [required]
--db TEXT MongoDB database name [required]
--collection TEXT MongoDB collection name [required]
--path TEXT Path to the aggregation pipeline json file [required]
--repeat INTEGER Number of repeats
--help Show this message and exit.
Python code
from mongometer import AggregationChecker
URI = "mongodb://test:test@localhost:27017"
DB_NAME = "shop"
COLLECTION_NAME = "bikes"
PIPELINE = [
{
"$match": {
"$text": {"$search": "John"},
}
},
{
"$sort": {
"created_at": 1
}
}
]
checker = AggregationChecker(URI, DB_NAME, COLLECTION_NAME)
checker.measure(pipeline=PIPELINE).print()
Related Skills
node-connect
353.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
