Skip to content

Instantly share code, notes, and snippets.

@parttimenerd
Created November 20, 2023 11:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save parttimenerd/a3b0c74eea0c1da89fec533ebd468479 to your computer and use it in GitHub Desktop.
Custom JFR events defined in Minecraft, obtained by using `jfr metadata` on a generated JFR file
@Name("minecraft.ChunkGeneration")
@Label("Chunk Generation")
@Category({"Minecraft", "World Generation"})
class ChunkGeneration extends jdk.jfr.Event {
@Label("Start Time")
@Timestamp("TICKS")
long startTime;
@Label("Duration")
@Timespan("TICKS")
long duration;
@Label("Event Thread")
@Description("Thread in which event was committed in")
Thread eventThread;
@Label("Stack Trace")
@Description("Stack Trace starting from the method the event was committed in")
StackTrace stackTrace;
@Label("First Block X World Position")
int worldPosX;
@Label("First Block Z World Position")
int worldPosZ;
@Label("Chunk X Position")
int chunkPosX;
@Label("Chunk Z Position")
int chunkPosZ;
@Label("Status")
String status;
@Label("Level")
String level;
}
@Name("minecraft.LoadWorld")
@Label("Create/Load World")
@Category({"Minecraft", "World Generation"})
class LoadWorld extends jdk.jfr.Event {
@Label("Start Time")
@Timestamp("TICKS")
long startTime;
@Label("Duration")
@Timespan("TICKS")
long duration;
@Label("Event Thread")
@Description("Thread in which event was committed in")
Thread eventThread;
@Label("Stack Trace")
@Description("Stack Trace starting from the method the event was committed in")
StackTrace stackTrace;
}
@Name("minecraft.NetworkSummary")
@Label("Network Summary")
@Category({"Minecraft", "Network"})
class NetworkSummary extends jdk.jfr.Event {
@Label("Start Time")
@Timestamp("TICKS")
long startTime;
@Label("Duration")
@Timespan("TICKS")
long duration;
@Label("Event Thread")
@Description("Thread in which event was committed in")
Thread eventThread;
@Label("Stack Trace")
@Description("Stack Trace starting from the method the event was committed in")
StackTrace stackTrace;
@Label("Remote Address")
String remoteAddress;
@Label("Sent Bytes")
@DataAmount("BYTES")
long sentBytes;
@Label("Sent Packets")
int sentPackets;
@Label("Received Bytes")
@DataAmount("BYTES")
long receivedBytes;
@Label("Received Packets")
int receivedPackets;
}
@Name("minecraft.PacketReceived")
@Category({"Minecraft", "Network"})
@Label("Network Packet Received")
class PacketReceived extends jdk.jfr.Event {
@Label("Start Time")
@Timestamp("TICKS")
long startTime;
@Label("Duration")
@Timespan("TICKS")
long duration;
@Label("Event Thread")
@Description("Thread in which event was committed in")
Thread eventThread;
@Label("Stack Trace")
@Description("Stack Trace starting from the method the event was committed in")
StackTrace stackTrace;
@Label("Protocol Id")
String protocolId;
@Label("Packet Id")
int packetId;
@Label("Remote Address")
String remoteAddress;
@Label("Bytes")
@DataAmount("BYTES")
int bytes;
}
@Name("minecraft.PacketSent")
@Category({"Minecraft", "Network"})
@Label("Network Packet Sent")
class PacketSent extends jdk.jfr.Event {
@Label("Start Time")
@Timestamp("TICKS")
long startTime;
@Label("Duration")
@Timespan("TICKS")
long duration;
@Label("Event Thread")
@Description("Thread in which event was committed in")
Thread eventThread;
@Label("Stack Trace")
@Description("Stack Trace starting from the method the event was committed in")
StackTrace stackTrace;
@Label("Protocol Id")
String protocolId;
@Label("Packet Id")
int packetId;
@Label("Remote Address")
String remoteAddress;
@Label("Bytes")
@DataAmount("BYTES")
int bytes;
}
@Name("minecraft.ServerTickTime")
@Label("Server Tick Time")
@Category({"Minecraft", "Ticking"})
class ServerTickTime extends jdk.jfr.Event {
@Label("Start Time")
@Timestamp("TICKS")
long startTime;
@Label("Duration")
@Timespan("TICKS")
long duration;
@Label("Event Thread")
@Description("Thread in which event was committed in")
Thread eventThread;
@Label("Stack Trace")
@Description("Stack Trace starting from the method the event was committed in")
StackTrace stackTrace;
@Label("Average Server Tick Duration")
@Timespan("NANOSECONDS")
long averageTickDuration;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment