Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
This PR adds support for asynchronously collecting timings, and for collecting timings from AsyncWorkers for AsyncTasks.
The implemented API allows custom collect callbacks to be registered, which allows plugins to include custom thread timings in timings reports. This is necessary because other threads' timings records can't be directly accessed from the main thread.
Relevant issues
Closes #6166
Changes
API changes
TimingsHandler::printTimings()
is now deprecatedgetToggleCallbacks()
,getResetCallbacks()
andgetCollectCallbacks()
toTimingsHandler
Behavioural changes
ThreadId
part of timer group names to namespace timer IDs (necessary since timer IDs could otherwise collide between different threads).Backwards compatibility
Should be fully backwards compatible
Follow-up
Requires translations:
Compiling timings report
Tests
I tested this PR by doing the following (tick all that apply):
tests/phpunit
folder)Samples
This requires a version of the timings viewer including the following commit: pmmp/timings@13cefa6
An example report can be viewed here: https://timings.pmmp.io/?id=330357