Reputation: 905
I try to get "workingSet" metrics with pymongo. In MongoDB is just db.runCommand( { serverStatus: 1, workingSet: 1 } )
. I've tried in python
from pymongo.mongo_client import MongoClient
connection = MongoClient('localhost', 27017)
db = connection['admin']
workingSetMetrics = db.command("serverStatus", "workingSet")
print 'workingSetMetrics: ', workingSetMetrics
My approach doesn't work. It the output isn't any "workingSet" metrics.
Any idea how i can get those metrics programmatically in python?
Upvotes: 3
Views: 607
Reputation: 446
>>> import pymongo
>>> c = pymongo.MongoClient()
>>> c['admin'].command('serverStatus', workingSet=True)['workingSet']
{u'note': u'thisIsAnEstimate', u'computationTimeMicros': 4555, u'pagesInMemory': 7, u'overSeconds': 388}
Upvotes: 4