通过mongoDB Java驱动程序获取mongoStat

编程入门 行业动态 更新时间:2024-10-28 17:29:55
本文介绍了通过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

本文发布于:2023-11-22 18:59:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1618619.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:驱动程序   mongoDB   Java   mongoStat

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!