Skip to content

Milliseconds per Tick#4243

Merged
AuroraLS3 merged 20 commits into
masterfrom
2279/mspt
Aug 29, 2025
Merged

Milliseconds per Tick#4243
AuroraLS3 merged 20 commits into
masterfrom
2279/mspt

Conversation

@AuroraLS3

@AuroraLS3 AuroraLS3 commented Aug 27, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR adds MSPT statistics to Performance tabs

TODO

  • Test using 1.18.1 Paper
  • Test using 1.21.4 Paper
    • Fix, The data was not recorded
  • Test using 1.21.8 Paper
    • Fix, The data was not recorded
  • Test using 1.21.8 Spigot
    • Fix, The data was not recorded
  • Test using API-14 Sponge
    • Fix, sponge-mixins.json was invalid
  • Test using Fabric
    • Fix, TPS task failed with java.lang.ClassCastException: class net.minecraft.class_3176 cannot be cast to class net.playeranalytics.plan.gathering.mixin.TickTimesAccess (net.minecraft.class_3176 and net.playeranalytics.plan.gathering.mixin.TickTimesAccess are in unnamed module of loader 'knot' @cb644e)

Affects issues:

@AuroraLS3

Copy link
Copy Markdown
Collaborator Author

How fun googling how to fix things and finding your own post as the answer https://www.spigotmc.org/threads/1-17-nms-how-to-get-instance-of-minecraftserver.514024/ 😆

@AuroraLS3
AuroraLS3 merged commit dd00b0e into master Aug 29, 2025
4 checks passed
@AuroraLS3
AuroraLS3 deleted the 2279/mspt branch August 29, 2025 08:47
@WarnDa

WarnDa commented Dec 23, 2025

Copy link
Copy Markdown

Hello,
I had some mspt above 50 so I did a spark with tick>50ms and saw that PLAN is one of my three plugins that is reported.
I'm fixing the two other plugin currently, but maybe plan can be fixed too !
https://spark.lucko.me/SlRnnoLv9R

image

@AuroraLS3

Copy link
Copy Markdown
Collaborator Author

This task is run once per second and takes 8 milliseconds due to reflective access to mspt array in MinecraftServer as there isn't a method to access it in Spigot

Please open a ticket since PR comments can't be tracked as something to fix

VRXDev2 pushed a commit to VRXDev2/Plan that referenced this pull request Jan 5, 2026
* Spigot MSPT method

* Implement MSPT for Paper, Sponge & Fabric

* Add average mspt and 95th percentile mspt to TPS object

* Add average and 95th percentile MSPT to database

* Update checkstyle to ignore ClassFanOutComplexity for Patches.java

Previously these were in SQLDB.java, which was also ignored, no longer is.

* Improve gathering accuracy by using direct data rather than aggregating averages

* Fix TPSQueries typo

* Add language for MSPT and a couple of small fixes

* Correct mspt access

- Support raw net.minecraft.server package in reflection
- The field contains nanos instead of millis, format accordingly.

* Add mspt to server graphs

* Add MSPT to performance as numbers, insights and network performance

* Increase all performance graph mspt softmax to 50

* Fix label

* Add mspt 95th percentile to Network performance

* Add functions to update themes with missing use cases and mspt colors to themes

* Remove outdated comment

* Map nanos to millis earlier so that overflows are avoided

* Add MSPT specific performance graph permission

* Fix sponge and fabric MSPT gathering

* Fix spigot MSPT field access

Affects issues:
- Close plan-player-analytics#2279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants