Getting mongoStat through mongoDB Java driver

假装没事ソ 提交于 2019-12-10 13:34:56

问题


Is there a way to get the results of the mongostat utility such as no. of queries/sec, inserts/sec, etc. through java driver. One way I find out was to get the serverstatus through the Mongo object as:

db.command("serverStatus")

and then get the total queries performed till now and then manipulate it to get queries per second.

Is there any other better way to get this information?


回答1:


You can use the Db.command("ServerStatus") function to get the Server Status and you can keep polling



来源:https://stackoverflow.com/questions/5310212/getting-mongostat-through-mongodb-java-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!