How to dump a RecordingStream?

Erik Gahlin erik.gahlin at oracle.com
Mon Nov 23 10:49:37 UTC 2020


Hi Gunnar, 

There is no way to dump a RecordingStream.

I have thought about the use case and prototyped it, but I have waited with the implementation because I like to add a RemoteRecordingStream first. It could impact the design.

The workaround, like you describe, is to use a Recoding for control and EventStream#openRepository() for reading the data.

I’m also thinking of adding something more advanced where you can filter out events to make the dumped recording smaller.

Cheers
Erik

> On 23 Nov 2020, at 10:00, Gunnar Morling <gunnar at hibernate.org> wrote:
> 
> Hi,
> 
> Is it possible to dump the underlying Recording of a JEP 349
> RecordingStream into a file at a given point in time?
> 
> I can't seem to find any way for doing that; so what I'm currently doing is
> to start a Recording, and then get a stream via
> EventStream.openRepository() which will expose the recording's events; That
> way, I have a reference to the Recording instance and can call dump(). Is
> this the right way to do it? Perhaps it would make sense to have a method
> dump() on RecordingStream(), too, so to simplify this?
> 
> My use case is that I'm examining the JFR events based on the stream. If it
> doesn't satisfy certain requirements, I'd like to dump the stream for
> offline analysis e.g. via JMC [1].
> 
> Thanks a lot,
> 
> --Gunnar
> 
> [1] https://twitter.com/gunnarmorling/status/1330623384418455559



More information about the hotspot-jfr-dev mailing list