Lab 4: Sensors for Monitoring Java Applications

The goal of this lab is to create a suite of java application sensors and use these sensors to produce graphs that summarize the values produced by the sensors during the execution of the java application from the first lab. The sensors will be used to monitor the execution of java applications passively and store the sensor values in some way (e.g., files, database). You are free to implement any number of sensors, but the more sensors you implement, the better for future labs. Examples of sensors are ones that monitor: CPU, heap memory, non-heap memory, stack depth, file access, network communication, class loading, and thread count usage. It is up to you to determine the sampling rate for the sensors and whether the sampling rate should be uniform across all of the sensors. Note that the sensors should not substantially limit the performance of the monitored application. In your report (part of the deliverables mentioned below) comment on the negative performance impact sensing has an the application being studied and justify your choice of sampling rate(s).

Implementing the sensors is straightforward, if you use the hooks provided by the Java virtual machine. The instructor has provided some java source code in file JVMRuntimeClient.java to show how this can be done. You must use a separate java program, which will be the program that will be monitored. Compile that program, and run it. Get its JVM process id and the run JVMRuntimeClient as a separate process on a second JVM (e.g., java JVMRuntimeClient -pid ). As the first program runs on one JVM, the other JVM running JVMRuntimeClient will output sensor values to stdio. Isuggest you use java version 1.6 or later.

After the sensors are implemented you are asked to deploy them on your java application and execute each feature of the application (you should use the test suite from the first lab to do this). Show the values of the sensors diagrammatically as a set of graphs. You should produce graphs for each pair of sensors and feature. You must show at least the following graphs for each sensor and for each feature (however, you can produce other types of graphs as you please):

Deliverables