Specification: system sensorhttps://195.227.0.189/NovaSpy/wiki/NovaSpy/Conceptual/OSSensor#Conceptoftheoperatingsystemsensors
Requirementhttps://195.227.0.189/NovaSpy/wiki/NovaSpy/Conceptual/OSSensor#Requirements
In complex Java applications performance problems can occur due to various factors. These problems should be detected and retaliatory actions performed. Monitoring the cpu usage (per core), the amount of total and free physical memory or the process cpu time are only a few points.
Monitoring should be possible with little impact on the design of the instrumented application. Instrumenting the VM would give us informations about such as the number of classes loaded, uptime of the JVM, the amount of memory consumed, number of threads running and deadlock detection. Another point would be the monitoring of the runtime stack.
It would be an advantage if the monitoring agent doesn't need to know anything about the application to instrument. Due to that, we would achieve an encapsulation. It should be considered in which intervals the monitoring happens and what the trigger is. The amount of the instrumentation should also be configurable (whole application or only pieces).
Approach
There are a few possible ways to achieve the points listed above. Java SE 6 provides an in-depth focus on performance, offering expanded tools for managing and monitoring applications and for diagnosing common problems. The improvements include:
- Monitoring and management API enhancements
- Official support for an improved graphical monitoring tool called JConsole
- Enhanced instrumentation of the Java virtual machine (JVM)
With this monitoring and management APIs it's possible to get extended informations about the VM such as current threads running, heap state or the memory usage. But there is one thing that can't be done with pure Java. That's where the JNI (Java Native Interface) comes into play. With the JNI it's possible to get informations like the cpu usage directly from the underlying OS.
[
https://195.227.0.189/NovaSpy/wiki/NovaSpy/Conceptual/OSSensor/AbstractApproaches] |