-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
TPS metric is inaccurate #23
Comments
I also have this issue on the latest version of Paper 1.14.4, it only seems to send the correct TPS every now and again. |
Same here, always reads 20. |
What are you guys comparing the TPS to? As far as I remember I re-used code from LagMeter while it was still open source and on GitHub. I was testing the TPS metric against the LagMeter I will keep this open and look into it when I get the time. |
After testing it does drop to like 14 or something, but it’s mostly inaccurate comparing to what I see in the output of in-game |
Was also seeing unexpected values out of this measurement, and took a look at the code. The issue is how TPS is being calculated. On TpsCollector.java#32 we have:
What this is doing is taking the amount of wall clock time between now and 40 ticks ago, measured in milliseconds, and then truncating it down to seconds. For this to show something other than 20, the TPS has to drop to such a low rate that the truncation produces a different value. In practice, this means the TPS has to drop down to about 13. This should probably be reclassified as a bug, not enhancement. Edit: another minor nitpick, is that in |
Just shade in https://github.com/lucko/spark/tree/master/spark-common for a TPS metric or borrow some code from it:
|
I know barely anything about java, so I'm probably not the best person to tackle this. However my first thoughts are to either change the type from IMHO, using a decimal data type is overkill (assuming that |
I understand this plugin isn't officially supported on 1.8, but the metric always reads 20. It'd be nice if it worked on 1.8 too!
The text was updated successfully, but these errors were encountered: