Supported data types for events
Erik Gahlin
erik.gahlin at oracle.com
Mon Apr 15 09:19:08 UTC 2019
Hi Philippe,
The supported data types in Java are primitives, java.lang.Class, java.lang.Thread and java.lang.String. You can see the list in the toType method here
http://hg.openjdk.java.net/jdk/jdk/file/tip/src/jdk.jfr/share/classes/jdk/jfr/internal/ASMToolkit.java
You can't use JSR-310 types, but it is possible to store durations and instants using the annotations @Timespan and @Timestamp on numeric fields.
In native, arrays are supported and it is possible to define you own composite data types, for example VirtualSpace You can see the list here:
http://hg.openjdk.java.net/jdk/jdk/file/tip/src/hotspot/share/jfr/metadata/metadata.xml
The file format only support “value types”, so it is not possible to store an array with different data types per element.
Cheers
Erik
> On 14 Apr 2019, at 20:48, Philippe Marschall <kustos at gmx.net> wrote:
>
> Hello
>
> I'm struggling a bit to find information about the supported data types
> for custom events. What seems to be supported are the following.
>
> - the primitive types and their wrappers
> - java.lang.String
> - java.lang.Class
>
> But I'm not sure what is additionally supported, eg.
> java.lang.reflect.Method doesn't seem to be supported.
>
> Are some of the following supported
> - JSR-310 (Java Date Time API)
> - java.sql Date Time types
> - java.util.Calendar
> - arrays or collections of the above types
>
> Cheers
> Philippe
More information about the hotspot-jfr-dev
mailing list