TAGS :Viewed: 8 - Published at: a few seconds ago

[ Java Mission Control - record mbean values ]

Is it possible to record mbeans values using Flight recorder? When I am monitoring my server in mbean mode I plot java.lang.management.OperatingSystemMXBean.getSystemLoadAverage() which works great. I would also like to get this value in flight recording dump.

In flight record wizard I can only select events, no mbeans options avaialable. Is there any way to do this?

Answer 1


You can add this functionality yourself; though you would have to rely on the unsupported API for creating JFR events:

http://hirt.se/blog/?p=444

You could, for example, create a Java agent that repeatedly fetches the values of interest, and records them as flight recorder events.

If you'd like, I could create such an agent. Would make a nice blog post, so I wouldn't mind. ;)

Answer 2


This depends on which attribute in the OperatingSystemMXBean that interests you, a number of them are already available as JFR events, for instance ProcessCpuLoad.

I believe some of the more OS centric values, like swap space, do not currently have corresponding JFR events. They could possibly be added in the future.

To generally record data from mbeans into JFR is not something we do, I don't think it's in any roadmap either.

There is a possibility to track the mbean data and save it (called 'JMX Data Persistence' or 'Historical Data' depending on your JMC version), but I'm guessing that's not what you want.

Answer 3


Adding a new answer since I did implement the agent I proposed in my first answer:

The easiest way is to download and use the agent I implemented and added to my blog here: hirt.se/blog/?p=689