Update 2013-02-06: Nowadays, I am a full user of
Coda Hale's Metrics library. I maintain a fork of the
metrics-scala component for different scala versions.
Followers of this blog may have noticed an emphasis on monitoring lately. This is because
my employer has decided to give me some time to investigate monitoring and create new components to ease the use of monitoring (in particular for Wicket applications). Blogging about the results is one of the requisites of this exercise.
This article lists all open source Java runtime monitoring tools I could find. By runtime monitoring I mean something that can left active in a production environment and measures things that occur
inside the JVM.
Jamon
Jamon started in 2003 and is probably the oldest monitoring framework listed here. Although Jamon’s last release is from 2007, it is quite stable and used a lot; Sourceforge statistics show almost a 1000 downloads per month. Jamon is the work of a single person.
Features:
- Programmatic access to start and stop timers, timers use milliseconds.
- In memory database for aggregate statistics (no details are kept).
Supports monitors that keep track of data in any unit (e.g. dollar value of a transaction).- Can aggregate statistics on data ranges to provide a more detailed view when this is necessary.
- Extensions to easily configure monitoring in software such as JDBC drivers, several servlet containers/application servers.
- A JSP page to view the realtime data.
Jamon does not support a persistence mechanism and there is therefore no way to analyze historic data. To fill this gap you can use
Jarep which provides several Jamon exports. Another way is to export the data through
JMX.
Java Simon
Simon started last year as a direct competitor of Jamon. It is much faster, measures in nanoseconds and has a hierarchy of monitors so that you can enable/disable a tree of monitors. Simon is still in active development. Be prepared for API changes in Simon 2.0 which is to be released somewhen before summer 2009.
Features:
- Programmatic access to start and stop timers, timers use nanoseconds.
- In memory database for aggregate statistics (no details are kept).
Supports stopwatches and counters.- Like Jamon, has a JDBC monitoring proxy driver
The Simon team is working on a JMX export and has yet to be determined plans for a persistence mechanism.
Currently Simon does not provide anything to view the statistics. Again you can use
Jarep for this.
Usemon
Usemon seems to target monitoring of large clusters with support for tracing messages through the cluster. Measurements are send to a collector which stores it in a database.
Features:
- Byte code manipulation to add timers to configured EJBs, Servlets, MDBs, custom defined POJOs, and classes implementing the SqlStatement, MessageSender and TopicSender interfaces.
- Measures method invocation durations, exception counts and JVM information such as heap size.
- Measurements are aggregated for 1 minute and then actively send to a central collector for storage.
- A nice graphic interface for viewing the data (the project page is very vague about the details).
- A clever database to handle huge amounts of data while still allowing efficient retrieval.
The Usemon site does not offer a lot of information. You'll probably need to just try it out to get more information.
Moskito
I found it a bit difficult to quickly grap Moskito. The website only shows a few use cases and leaves the rest undocumented.
Features:
- Easy monitoring of servlets.
- Measurements are aggregated per interval (e.g. 5 miniutes). Afterwards you can do something with the data (e.g. log it or send to a central location).
- A nice very complete looking web interface.
A nice idea (that has not been implemented) is the support for virtual monitors, a monitor that shows the aggregated statistics for several other monitors.
Unfortunately I could not figure out how to instrument code except for servlets (extending a base class). The project website suggest that the project has been abandoned, so Moskito is not likely a good choice.
Commons monitoring
Commons monitoring is a Apache sandbox project. The website has good documentation but the newest information is from March 2008. SVN shows quite some activity so I am curious what the first release will bring.
Features:
- Programmatic access to start and stop timers, timers use nanoseconds.
- Support for AOP instrumentation.
- In memory database for aggregate statistics (no details are kept).
- Supports timers, counter (only increases) and gauges (increases and decreases).
- Extensions to export data through a servlet in several formats, including HTML.
JETM
JETM (Java™ Execution Time Measurement Library) is again a library for doing raw measurements.
Features:
- Programmatic access to start and stop timers, timers use nanoseconds.
- Very nice: a Spring namespace to configure monitors on your beans.
- In memory database for aggregate statistics (no details are kept).
- In memory database for aggregate statistics (details are kept until it is time to calculate the aggregates).
- Several renderers to export data.
- Web interface to see current data.
- Integrates with several projects as Spring, RRD4J and JMX.
Although JETM looks nice, it has been silent for more then a year, and simple questions on the mailing list are not answered.
Project Broadway
Broadway provides an entirely different kind of monitoring. The idea of Broadway is to define events of interest (for example in Groovy) on which can be reacted with some action.