我正在考虑从JVM中捕获一些指标,例如max / min / used内存,cpu消耗以及稍后可能更多。
我做了一些研究但找不到合适的东西。
请问我是否正确阅读,从哪里开始?
请注意,我不是在寻找市场上的任何类型的软件而不是阅读materilas如何通过JMX以编程方式获取指标,因此,我能够将这些存储在数据库或文件中。
答案 0 :(得分:2)
IBM发表了一篇非常好的文章:http://www.ibm.com/developerworks/library/j-rtm1/index.html?ca=dgr-jw22javaruntime1&S_TACT=105AGX59&S_CMP=GR
它有三个部分,包含详细信息和说明。
Part 1:
Explores attributes of application performance management (APM) systems
Describes common antipatterns for system monitoring
Presents methods for monitoring the performance of JVMs
Offers techniques for efficiently instrumenting application source code
Part 2 will focus on methods of instrumenting Java classes and resources without modification of the originating source code.
Part 3 will address methods for monitoring resources outside the JVM, including hosts and their operating systems and remote services such as databases and messaging systems. It will conclude with a discussion of additional APM issues such as data management, data visualization, reporting, and alerting.
答案 1 :(得分:1)
查看JMX stats available以及如何使用JConsole监控它们。默认情况下可以使用大量统计信息(垃圾收集信息,内存池,线程统计信息)。 CPU有点棘手,但请查看this SO question了解更多详情。
请注意,您不必仅使用JConsole。您可以轻松编写自己的监视器来整理这些统计数据。