[SPIGOT-6386] No simple method to get server TPS Created: 03/Mar/21 Updated: 04/Mar/21 |
|
Status: | Open |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Joshua Price | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 2 |
Labels: | None |
Attachments: |
![]() |
Version: | Latest / N/A |
Guidelines Read: | Yes |
Description |
There is no easy way to get the server's TPS without calculating it yourself (ew) or using reflection (meh). A method such as Server#getTPS() should be implemented, along with Server#getRecentTPS(). The first would return the current TPS and the latter would return an array of the 3 values shown by the /tps command. |
Comments |
Comment by Joshua Price [ 04/Mar/21 ] |
I have opted to create one method—getTPS. It is just the array with the recent TPS values. This is to ensure compatibility downstream with Paper and because it's simpler. |
Comment by Joshua Price [ 03/Mar/21 ] |
Done with the code, ready to PR, but I'm waiting for some assistance in the Discord server. |
Comment by Joshua Price [ 03/Mar/21 ] |
I'm working on a PR for this. |