我在考虑从JVM中捕获一些指标,比如最大/最小/已用内存、cpu消耗等等。
我做了一些研究,但找不到任何合适的东西。
请告诉我正确的读物,从哪里开始?
请注意,我不是在市场上寻找任何种类的软件,而是关于阅读材料如何通过JMX编程获得指标,所以,我能够将这些存储在数据库或文件中。
发布于 2012-11-14 21:56:39
来自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.发布于 2012-11-14 21:49:04
查看JMX stats available以及如何使用JConsole监控它们。默认情况下提供了许多统计信息(垃圾收集信息、内存池、线程统计信息)。CPU有点棘手,但请查看this SO question了解更多详细信息。
请注意,您不必只使用JConsole。您可以很容易地编写自己的监视器来整理这些统计数据。
https://stackoverflow.com/questions/13380047
复制相似问题