VisualVM/VisualGC provides quite a lot of useful GC-related metrics in real-time, but I want a command-line tool that can connect to a remote application via jstatd and record in CSV or XML ideally exactly the same metrics as VisualGC provides. It shouldn't be a problem to write my own, but from the first look I cannot find what protocol visualvm/jstatd use.
As I understand VisualGC is not open source: https://stackoverflow.com/questions/11096466/where-is-the-source-code-repository-for-visualgc, but are there any alternative open source tools? Are there any clues how about the protocol used?
I managed to connect to jstatd via RMI (default port 1099, JStatRemoteHost is the rmi-name), can attach to a particular VM - but http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/jvmstat/monitor/remote/RemoteVm.java#RemoteVm is rather a very low-level interface with jstatd.
I've checked out the VisualVM source code from https://svn.java.net/svn/visualvm~svn/trunk and just started looking at the 5mb codebase, however it doesn't use neither RemoteHost nor RemoteVm RMI-classes.
Thanks.