3 ms·
Can you give some real world examples when to use JFR custom events? The Minecraft example is not helpful when I know nothing about Minecraft.
by TedDoesntTalk 3y ago
Can you give some real world examples when to use JFR custom events? The Minecraft example is not helpful when I know nothing about Minecraft.
- gunnarmorling 3y agoI've written about two applications of custom JFR events in the past: * Monitoring invocations of a REST API: https://www.morling.dev/blog/rest-api-monitoring-with-custom-jdk-flight-recorder-events/ https://www.morling.dev/blog/rest-api-monitoring-with-custom... * Tracking SQL queries issued by your ORM: https://www.javaadvent.com/2021/12/keep-your-sql-in-check-with-flight-recorder-jmc-agent-and-jfrunit.html https://www.javaadvent.com/2021/12/keep-your-sql-in-check-wi... The latter is about injecting event-emitting code with a Java Agent rather than manually implementing custom events (latest Hibernate ORM version comes with JFR support OOTB, too).
- gred 3y ago> Monitoring invocations of a REST API Yep, we use custom JFR events to track API calls and correlate them to other built-in JFR events and statistics (garbage collection, memory use, allocations, CPU use, deadlocks, etc).
- parttimenerd 3y agoYou might be interested in a proposal by Jaroslav Bachorik to add context into JFR. I wrote a short introduction on my blog "Putting JFR into Context" (https://mostlynerdless.de/blog/2023/10/19/putting-jfr-into-context/ https://mostlynerdless.de/blog/2023/10/19/putting-jfr-into-c...)
- parttimenerd 3y agoThank you Gunnar, I linked to your blog post (and even linked to it already in my previous blog post "Custom JFR Events: A Short Introduction" https://mostlynerdless.de/blog/2023/11/20/custom-jfr-events-a-short-introduction/ https://mostlynerdless.de/blog/2023/11/20/custom-jfr-events-...)