I am implementing a custom JFR event that samples a counter at a certain interval. It would be awesome if this event and interval could be configured in a .jfc
configuration file like the built-in events. For that to work I need programmatic access to the configured value. Through EventFactory
if have access to the SettingDescriptor
but this gives me only the default value, not the current value.
I had a look at jdk.jfr.internal.settings.PeriodSetting
but this is an internal class.
Custom events can be configured in a .jfc file.
or programmatically with a Map:
or using fluent API:
The time when events are emitted is determined by the framework:
If the field layout of the event is unknown at compile time, so you have to use the EventFactory, you can do: