Commit Graph

94 Commits

Author SHA1 Message Date
Dylan K. Taylor
22b10e4cb0 Timings: Stop using BREAKDOWN group
with tree timings, the breakdown is actually pretty annoying, since it makes it hard to find a timer in the aggregate lists.
2023-11-10 15:36:35 +00:00
ShockedPlot7560
64e09525f3 Added timings for AsyncTask completion handlers, progress updates and error handlers (#5798)
closes #5749
2023-06-20 12:38:45 +01:00
Dylan K. Taylor
ee9ce8a4f4 Merge branch 'minor-next' into major-next 2023-05-17 15:45:03 +01:00
Dylan K. Taylor
5c85a7c306 Merge remote-tracking branch 'origin/stable' into minor-next 2023-05-16 22:54:53 +01:00
Dylan K. Taylor
077fac84bf Added aggregate timers for all world timings
this allows timings list view to display totals for these sections. It does make the tree view a bit more annoying in some cases though.
2023-05-08 16:27:46 +01:00
Dylan K. Taylor
fdb3a5b121 Fixed incorrect implementation of peak timings 2023-05-07 18:29:37 +01:00
Dylan K. Taylor
5c7f4570b4 Merge branch 'minor-next' into major-next 2023-05-06 17:20:37 +01:00
Dylan K. Taylor
bb60a9057f Merge branch 'stable' into minor-next 2023-05-06 17:08:29 +01:00
Dylan K. Taylor
fa715a074a Fixed TimingsHandler depth not getting reset when timings is disabled
When timings was disabled, internalStopTiming is not called, and timer depth is not decremented.
If timings is later reenabled, the next call to internalStartTiming will think the timer is already running, and won't generate any new records for the timer.
This has led to broken timings reports with missing Full Server Tick entries, amongst other things.
2023-05-06 16:56:39 +01:00
Dylan K. Taylor
d04da9b1d8 Reuse timings handlers for event handlers of the same events
due to direct repeated usage of registerEvent() with closures, we've seen some libraries like muqsit/SimplePacketHandler generate very large timings reports, because a new timings handler gets created every time a plugin registers or unregisters a new packet handler callback.

This change fixes the problem by ensuring that any handlers derived from the same function, handling the same event class, will share the same timer.
2023-05-06 15:42:52 +01:00
Dylan K. Taylor
a0346fb6d3 Merge branch 'minor-next' into major-next 2023-04-26 14:29:32 +01:00
Dylan K. Taylor
eb4679fefd Merge remote-tracking branch 'origin/stable' into minor-next 2023-04-26 14:28:29 +01:00
Dylan K. Taylor
f9318bf286 TimingsHandler: stop throwing exceptions when timers aren't stopped in the right order
this is usually because of an uncaught exception interacting with a try...finally block.
This will normally result in a crash anyway, and we don't want to obscure the real error.
2023-04-21 15:38:11 +01:00
Dylan K. Taylor
1026811741 Merge branch 'minor-next' into major-next 2023-04-14 21:00:08 +01:00
Dylan K. Taylor
84cb070d56 Merge branch 'stable' into minor-next 2023-04-14 20:12:33 +01:00
Dylan K. Taylor
6c6f686f8e Timings: be more intelligent about shortening timer names
non-pocketmine classes may reuse the names of pocketmine core classes. We don't want timers to get erroneously reused in this case.
2023-04-14 18:24:53 +01:00
Dylan K. Taylor
bf7975da57 Timings: use class to index packet timings, not IDs
on multi version servers, the same packet may have different IDs, or different packets might use the same ID. In these cases, we don't want the timings to get split up or erroneously reused.
2023-04-14 18:22:35 +01:00
Dylan K. Taylor
7aeedd8220 Timings: fixed every player getting its own timings
we need a more consistent way to deal with this
2023-04-14 17:32:56 +01:00
Dylan K. Taylor
b80d7a57e3 Merge branch 'minor-next' into major-next 2023-04-11 23:56:28 +01:00
Dylan K. Taylor
a6e79c5004 TimingsHandler: remove useless paste metadata
these fields are not used by any version of timings, so this code is redundant.
2023-04-11 23:45:01 +01:00
Dylan K. Taylor
ed88d68fd7 Remove stuff deprecated in 4.19.0 2023-04-11 23:20:58 +01:00
Dylan K. Taylor
a0dadc6e37 Merge branch 'minor-next' into major-next 2023-04-10 14:38:23 +01:00
Dylan K. Taylor
1683aa681d TimingsHandler: added format version 2023-04-06 15:08:49 +01:00
Dylan K. Taylor
bf84caa02c Timings: record peak tick time and active ticks
this information is useful for determining the sizes of lag spikes, and giving more accurate average times.
2023-04-06 15:05:40 +01:00
Dylan K. Taylor
61b0ad3e7f PreSpawnPacketHandler: added dedicated timer for the humongous amount of crap that has to be sent pre-spawn 2023-04-05 20:58:49 +01:00
Dylan K. Taylor
b2f755720d Use a proper Breakdown timing group instead of the unwieldy INCLUDED_BY_OTHER_TIMINGS_PREFIX 2023-04-05 20:47:47 +01:00
Dylan K. Taylor
8ef2780dcd Use group format for tasks 2023-04-05 20:35:54 +01:00
Dylan K. Taylor
7e1467f3f7 Merge branch 'minor-next' into major-next 2023-04-05 20:14:59 +01:00
Dylan K. Taylor
73522d06ef ... 2023-03-31 21:51:07 +01:00
Dylan K. Taylor
199ef7401f Revert "Timings: do not shorten event handler timing names"
This reverts commit a2ff9649d5.
2023-03-31 21:49:25 +01:00
Dylan K. Taylor
d731f5485a Merge branch 'minor-next' into major-next 2023-03-31 21:29:42 +01:00
Dylan K. Taylor
f63d349be4 Merge remote-tracking branch 'origin/stable' into minor-next 2023-03-31 21:28:14 +01:00
Dylan T
02e11b5a60 Timings tree (#5587)
Split timings into tree reports
this will allow the timings site to display timings as a tree, instead of as a list as is done now, which will enable more precise identification of performance issues.

An example of this can be seen here: https://timings.pmmp.io/?id=302629

The format changes are fully backwards compatible, as the timings site
aggregates timings from timers with the same names, and doesn't limit
how much extra data can appear at the end of a line.
2023-03-31 21:26:58 +01:00
Dylan K. Taylor
4a770e5801 CS 2023-03-31 20:32:42 +01:00
Dylan K. Taylor
a2ff9649d5 Timings: do not shorten event handler timing names
this doesn't work very well in tree view timings
2023-03-31 19:44:06 +01:00
Dylan K. Taylor
5ac0d7ae11 TimingsRecord: fixed incorrect violations calculation
closes #5665
2023-03-31 17:08:59 +01:00
Dylan K. Taylor
0c47455b24 Timings: ensure that Average Players count is shown properly when custom player classes are used 2023-03-30 18:12:06 +01:00
Dylan K. Taylor
10f3145af2 Merge branch 'minor-next' into major-next 2023-03-29 23:22:02 +01:00
Dylan K. Taylor
5e1f837a73 ... 2023-03-28 22:46:18 +01:00
Dylan K. Taylor
b49a9ae81d Added timings for calling events
this gives a somewhat better overview of events, particularly if many plugins are subscribed to the same costly event (e.g. PlayerMoveEvent).

In addition, it allows us to see the frequency that events are occurring.
2023-03-28 17:26:20 +01:00
Dylan K. Taylor
04197d6b80 Merge remote-tracking branch 'origin/minor-next' into major-next 2023-03-27 19:08:34 +01:00
Dylan K. Taylor
c1cef19f84 stringifyKeys 2023-03-27 01:17:15 +01:00
Dylan K. Taylor
cebdb95265 Optimise plugin timings report entries
this format is already supported by the timings host, so no changes are required to support this.
2023-03-27 01:15:42 +01:00
Dylan K. Taylor
a4d34be6df Merge branch 'minor-next' into major-next 2023-03-20 23:42:40 +00:00
Dylan K. Taylor
e7771d76f2 Cover buffered inventory sync in timings 2023-03-20 23:29:02 +00:00
Dylan K. Taylor
7cdab75b05 Merge branch 'minor-next' into major-next 2023-03-20 22:12:54 +00:00
Dylan K. Taylor
419962d3a2 Added timer for player-specific movement code
players use an entirely different pathway for movement processing, which could be costly.
2023-03-19 16:12:47 +00:00
Dylan K. Taylor
054c06fab9 Add specialized entityBaseTick timer for item entities
since item merging is a potential hotspot, we want to know if this code section is a performance problem.
Current timers only tell us whether overall ticking of a particular entity is slow, but that includes movement and therefore isn't particularly helpful.
2023-03-19 15:59:06 +00:00
Dylan K. Taylor
7bc5d8c824 Rename more timers 2023-03-19 15:57:36 +00:00
Dylan K. Taylor
607bdfa42f Timings: added new timers for entity move collision checks and projectile move ray tracing
projectiles get their own distinct sub-timer, since the logic is completely different from regular entities.
2023-03-19 15:49:35 +00:00