سؤال

I need to monitor the performance of a Java process and take reports automatically. The reports should contain data on memory utilization thread usage, process usage etc. But I'm unsure how to accomplish this. Any suggestions?

هل كانت مفيدة؟

المحلول 2

You may use JMX API for this purpose if want to get the data via program. Here is oracle tutorial on this topic.

If you just want to monitor the process, there are tools like VisualVM.

نصائح أخرى

I need to monitor the performance of a Java process and take reports automatically.

You need to determine what measures are important to the users of the application like latency and throughput. These are often impacted even if everything looks fine system wise. For example an 8 cpu system which is only 6% busy over 5 minutes might sound fine, except it could be that there is one request every 5 minutes which is taking more than 2 minutes.

The reports should contain data on memory utilization thread usage,

A key feature of threads share objects by default. This means the thread local memory usage is almost always trivial and not worth measuring in general.

process usage etc.

This can be useful for capacity planning of a long period of time, but not useful for find application specific problems (see above).

But I'm unsure how to accomplish this. Any suggestions?

Work out what metrics will help you find problems which impact the users of the application.

VisualVM is a nice tool to monitor memory utilization and other things VisualVM

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top