本文介绍了通过mongoDB Java驱动程序获取mongoStat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以获取 mongostat 实用程序的结果,例如否.通过Java驱动程序进行查询/秒,插入/秒等操作. 我发现的一种方法是通过Mongo对象获取serverstatus:
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:
dbmand("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?
推荐答案您可以使用Dbmand("ServerStatus")函数获取服务器状态,并且可以继续进行轮询
You can use the Dbmand("ServerStatus") function to get the Server Status and you can keep polling
更多推荐
通过mongoDB Java驱动程序获取mongoStat
发布评论