Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Setting probe thresholds declaratively

John GreggAug 10 2022

All,
Is it possible to set thresholds in the JFR agents XML file? It doesn't appear to be.
To be clear, I'm talking about the file that looks like this:

<jfragent>
  <events>

    <event id="...">

    </event>
  </events>
</jfragent>

I'd like to set a threshold like 10ms, 20ms, etc.
thanks

Comments

John Gregg

Ok, I got it. The threshold needs to be set in a settings file that is passed at startup:
-XX:StartFlightRecording:filename=myrecording.jfr,settings=src/main/resources/custom.jfc
The content of the file looks like this:

<configuration version="2.0" label="John's Custom Events" description="John's Custom Events." provider="Events 'R' Us">

    <event name="My Custom Event">
      <setting name="enabled">true</setting>
      <setting name="threshold">100 ms</setting>
    </event>

</configuration>
1 - 1

Post Details

Added on Aug 10 2022
1 comment
352 views