5 ms·
Custom Events in the Blocky World: Using JFR in Minecraft
- darknavi 3y agoWow! Blast from the past. I helped implement the JFR events a few years ago in the Java Edition of Minecraft (and probably caused some of the metadata wonkyness, whoops). I work in the Bedrock version normally but hopped over to lend a hand. There was a big push to determine the performance impact of enlarging the world height for the caves and cliffs update. Really glad to see people playing with the events.
- parttimenerd 3y agoThat's pretty cool. We could have a chat (me@<blog-url> is my mail address), if you like, I'm always interested in people using profilers in the real-world :)
- pugworthy 3y agoJFR is... Java Flight Recorder? https://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-guide/about.htm https://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-g... I find it both an interesting challenge to discover what people mean when they confidently toss out acronyms, while also an annoyance for randomly throw out acronyms.
- KolmogorovComp 3y agoIt is explained in the first screenshot of the article. > Commands/jfr > Commands Starts and stops profiling with Java FlightRecorder (…)
- chankstein38 3y agoDid you NOT read the article then _confidently toss out comments, while I also have an annoyance for people who comment without reading the article?_
- _lvbh 3y agoIt’s literally in the first sentence
- bradhe 3y agoSomehow when I read the title I thought article was going to describe how to use Minecraft to visualize JFR profiles which I thought could be pretty cool…
- uberswe 3y agoI'm not sure how much of the built in JFR a mod for Minecraft called Spark uses but it is a fairly common tool for debugging and visualising lag on modded servers https://spark.lucko.me/ https://spark.lucko.me/
- skerit 3y ago"We could disassemble the Minecraft JAR and potentially get into legal trouble" Hehe, I wouldn't worry about that too much with minecraft.
- exabrial 3y agoPeople may dislike Java syntax in some areas (I argue this is the lack of IDE knowledge, but I digress), but the JVM itself is the friendliest thing the run in production. Between JMX, JFR, Java Agent[s] like Hawt.io, one can really drill down into problems; everything is visible.
- parttimenerd 3y agoI'm the author, ask me things.
- TedDoesntTalk 3y agoCan 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-...)