如何以编程方式转储 JMX 数据?
我希望能够记录可通过 jconsole 访问的所有 JMX 数据。有没有办法以编程方式执行此操作?我正在构建一种系统日志记录形式,并且我想创建可使用类似于 jconsole 的工具查看的间隔数据。
我该怎么做呢?
I want to be able to log all JMX data accessible via jconsole. Is there a way to do this programmatically? I'm building a form of logging of the system, and I want to create intervaled data viewable with some tool similar to jconsole.
How would I go about doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
java.lang.management.ManagementFactory< /a> 使您可以访问 JMX 数据。
ig
一些示例可在 SO 查询中找到:[java]+managementfactory
很好的阅读:https://www.ibm.com/developerworks/library/j-jtp09196/index.html
对于连接到远程 VM 的完整实现:
从信息中,您可以根据需要查询对象名称和属性。
java.lang.management.ManagementFactory gives you access to JMX data.
i.g.
Some samples are available at SO query: [java]+managementfactory
A good read: https://www.ibm.com/developerworks/library/j-jtp09196/index.html
For full implementation connecting to a remote VM:
From the info, you can query object names and attributes as desired.
当我想做同样的事情时,我使用这个 命令行 JMX 客户端 作为起点。
I used this command line JMX client as a starting point when I wanted to do the same thing.