RFR: 6988: Initial implementation of JFR binary format writer

Marcus Hirt hirt at openjdk.java.net
Fri Nov 20 18:50:21 UTC 2020


On Fri, 19 Jun 2020 10:22:41 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:

> This is an initial implementation of JFR binary format writer in Java.
> The writer can write valid JFR files according to what is expected by the JMC JFR format reader.
> The writer is not complete in terms of performance and event settings support but in spite of that it is fairly usable.
> 
> The typical flow is:
> 
> 1. Obtain a new instance of Recording
>  java
> Recording r = new Recording()
> 2. Register custom types for that recording
>  java
> r.registerType(name, structure)
> 3. Get a new Chunk instance
>  java
> Chunk c = r.newChunk()
> 4. Write event values
>  java
> c.writeEvent(eventValue)
> 5. Finish the chunk and get the binary data
>  java
> byte[] data = c.finish()
> 
> 
> For more complex usage check [ChunkComplexTest.java](https://github.com/openjdk/jmc/pull/84/files#diff-c4c8e65a0fa563655c55be91602af6ab).

Hi @jbachorik! To get this out for review on the list, you'll need to have an associated JBS issue, and update the PR to start with the issue number.

-------------

PR: https://git.openjdk.java.net/jmc/pull/84


More information about the jmc-dev mailing list