Forum Stats

  • 3,853,778 Users
  • 2,264,267 Discussions
  • 7,905,444 Comments

Discussions

Setting probe thresholds declaratively

John Gregg
John Gregg Member Posts: 42 Blue Ribbon

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

Answers

  • John Gregg
    John Gregg Member Posts: 42 Blue Ribbon

    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>