servertap-io / servertap

ServerTap is a REST API for Bukkit/Spigot/Paper Minecraft servers
https://servertap.io
MIT License
235 stars 57 forks source link

Add TPS (1m, 5m, 15m) and MSPT to ServerHealth using Paper API #104

Closed jegt closed 2 years ago

jegt commented 3 years ago

Uses the existing TPS data from org.bukkit.Bukkit which includes 1m, 5m and 15m (instead of just 1m) and also average MS per tick. Probably better to use the existing implementation for this than implementing it again in Lag(). I also moved these metrics to ServerHealth instead of Server.

phybros commented 3 years ago

@jegt can you add a description to the PR? What problem does this solve, why is it better than the existing Lag() code etc. Thank you!

jegt commented 3 years ago

@phybros Added a description. Hope this is clearer.

Scarsz commented 3 years ago

This PR would alienate any non-Paper users... hard pass from me. While Paper is certainly popular, not everyone who runs a Bukkit API-compatible server will be running a Paper one.

The old Lag code needs to stay in place as a fallback.

jegt commented 2 years ago

I can understand that you want to keep it backward compatible. I'm not sure exactly how to make it compatible with non Paper servers since I need to specify the new Paper API in pom.xml. Its been 10+ years since I did any Java coding =)

zoeleu commented 2 years ago

Doesn't spigot also have a TPS API?

jegt commented 2 years ago

@matteoturini No it seems to only be available for Paper.

zoeleu commented 2 years ago

Just looked it up, and you can use NMS and Reflection to get the TPS. Seems better than Paper API.

jegt commented 2 years ago

Unfortunately I don't have the time to do that. I guess I will just have to maintain this branch for my own use.