CC: Tweaked

CC: Tweaked

42M Downloads

JMX monitoring for CC: Tweaked

SquidDev opened this issue · 2 comments

commented

Minecraft 1.16 now provides a JMX monitoring interface:

A new flag enable-jmx-monitoring has been added to the server.properties file which if set to true will expose an MBean with the Object name net.minecraft.server:type=Server and two attributes averageTickTime and tickTimes exposing the tick times in milliseconds

We should hook into this system and expose beans for all the various tracking fields. This should make the existing prometheus exporter largely redundant, as people can just drop in one of the many existing JMX → Prometheus ones.

commented

Having had a prod at this, I'm really not sure there's a way to do it elegantly. Given the dynamic nature of computers, we'd need to register and unregister MBeans an awful lot, which is pretty vile.

commented

I've added global statistics in the following commit. As mentioned above, there's not really a "nice" way of doing per-computer metrics (short of dynamically registering beans, or just returning an Int -> Long map), so that will be ignored for now.