Showing posts from March, 2015

Using jstat to report custom JVM metric sets

I've always been missing possibility to configure custom headers in JStat. Of course there are a lot of predefined data sets, but it'll be nicer if we could create our own data set. And as you probably already devised I'm writing this post because such functionality is of course available :) Unfortunately I haven't found it in any documentation so now I'll try to fill this gap.

First thing we have to do is to provide custom descriptor with possible JStat options. This descriptor is just a text file containing something we'll call "jstat specification language". To make this custom file available to JStat we should place it in the following path: $HOME/.jvmstat/jstat_options
If you want to view the bundled options please refer to file in OpenJDK repository.

The specification language is pretty similar to json files, and it contains the group of option elements. Each option should be threaten as a set of columns that can be shown in single jstat executi…