1from pymongo
2import MongoClient
3client = MongoClient()
4db = client.test
5# print collection statistics
6# events is the collection name here
7print(db.command("collstats", "events"))
8# print database statistics
9print(db.command("dbstats"))