Slimefun4
Slimefun4 copied to clipboard
Added new flags for timings
Description
Timings are pretty cool however we can't currently change the order. Now, we can!
This PR allows for 2 new flags --avg
and --low
. --avg
will order the timings based on average rather than total. --low
will order the timings lowest to highest.
In Action
Default (no flags)
Average (--avg
)
Low (--low
)
Proposed changes
Instead of just adding average I decided to make a proper way so that we can add more ordering later. Due to me doing it this way I also added low.
- Created SummaryOrderType
- Added PerformanceInspector#getOrderType
- Added
sortTimings
in PerformanceSummary - Docs improvement
Still to do
- Improve docs - please suggest a better message
- ~~Improve the mess of average sorting~~ https://github.com/Slimefun/Slimefun4/blob/a488e213b5ad42b5e65b7cafc48ab628c06337f4/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/profiler/PerformanceSummary.java#L219-L231
Related Issues (if applicable)
N/A
Checklist
- [x] I have fully tested the proposed changes and promise that they will not break everything into chaos.
- [ ] I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
- [x] I followed the existing code standards and didn't mess up the formatting.
- [x] I did my best to add documentation to any public classes or methods I added.
- [x] I have added
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values - [ ] I added sufficient Unit Tests to cover my code.
Your Pull Request was automatically labelled as: "🎈 Feature" Thank you for contributing to this project! ❤️
Slimefun preview build
A Slimefun preview build is available for testing! Commit: 84c075b9
https://preview-builds.walshy.dev/download/Slimefun/3246/84c075b9
Note: This is not a supported build and is only here for the purposes of testing. Do not run this on a live server and do not report bugs anywhere but this PR!
here's the results of my testing with a small amount of items
with --avg
with --low
appears to be working
can we get some reviews on this?