Guidance on parsing db.command("serverStatus")

50 views
Skip to first unread message

Ian

unread,
Sep 6, 2010, 11:16:35 PM9/6/10
to mongodb-user
I'm trying to obtain performance statistics for a mongodb instance
with the following command:
Map mymap = db.command("serverStatus").toMap();


Many of these keys map to integer values, but some map to another
Map. Could anyone suggest how best to iterate through these various
levels?

Thanks in advance for any guidance.

Dwight Merriman

unread,
Sep 7, 2010, 5:16:05 AM9/7/10
to mongod...@googlegroups.com
i guess it depends what you want to do with the values. you might
want to right a recurive function to depth first traverse.

tojson( db.runCommand("serverStatus") )

can be useful to get the whole thing as a string for output or logging

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages