Find what makes your plugin lag
How many milliseconds per tick your plugin uses on real servers, which of your methods cost the most, and whether the last release made it slower.
The problem
A profiler like spark shows what's slow on one server, the one you're on. Your plugin runs on hundreds, with different worlds, player counts and configs. The lag owners complain about may only happen with their setup, and you never see it.
How it works
- Nothing to add: the SDK samples the server's main thread about ten times a second and records when it's inside your plugin's code.
- Your event handlers and commands are timed automatically.
- Optionally, wrap any block in a span to measure it by name.
try (PluginAnalytics.Span span = analytics.time("arena_tick")) {
tickArenas();
}
What you see
- Milliseconds per tick your plugin uses, on average across servers
- The most expensive methods, as Entry > Inner (the task or listener, and where the time goes)
- Event handlers and commands with calls, average, p95 and slowest call
- A comparison between versions, with a notification when a release is slower
- The server's tick time (MSPT) on Paper, for context
Questions
Does sampling slow down the server?
No. A low-priority thread looks at the main thread about ten times a second. You can turn it off with autoPerformance(false).
Is it a replacement for spark?
It's a complement. This shows what costs time across all servers; spark on a test server shows why. See PluginAnalytics vs spark.
Does it work on Folia?
Folia has no single main thread, so sampling is off there; spans still work.
Try it on your plugin
Free for your first plugin. One line in onEnable.