Monitoring one's server resources is crucial as we have already learnt in our previous articles. However, if you are running a JVM on your server, there are more important things to monitor.
Java has a number of built-in tools which let us get information about each of your JVMs running on the machine. Some of them are: jstat, jmap and jstack
Let's focus on the first one: jstat
. It allows us to collect information about the JVM utilization and gargabe collector statistics. Those two metrics are very interesting for every conscious JVM user. With the use of jstat
command and awk
we can pretty easily monitor the JVM Heap Utilization. Below, there is an example of a bash function doing so.
The other aforementioned metric - full garbage collection time - is very similar.
If you are wondering what those functions are or what they are for, it means that you need to read our tutorials for Windows
After implementing our functions, executing the script and waiting for some time, our charts in CULA are ready.
Sign into CULA
and begin using our server monitoring straight away. Be as creative as you need to be.