Slimefun4 icon indicating copy to clipboard operation
Slimefun4 copied to clipboard

Added new flags for timings

Open WalshyDev opened this issue 2 years ago • 3 comments

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) default

Average (--avg) avg

Low (--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 and Nullable annotations to my methods to indicate their behaviour for null values
  • [ ] I added sufficient Unit Tests to cover my code.

WalshyDev avatar Sep 12 '21 09:09 WalshyDev

Your Pull Request was automatically labelled as: "🎈 Feature" Thank you for contributing to this project! ❤️

github-actions[bot] avatar Sep 12 '21 09:09 github-actions[bot]

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!

github-actions[bot] avatar Jul 09 '23 00:07 github-actions[bot]

here's the results of my testing with a small amount of items

with --avg image

with --low image

appears to be working

Boomer-1 avatar Jul 09 '23 01:07 Boomer-1

can we get some reviews on this?

J3fftw1 avatar Jul 29 '23 17:07 J3fftw1