Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve human readable output #459

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

eworm-de
Copy link
Contributor

Calculate in a loop, use dynamic precision.

@eworm-de
Copy link
Contributor Author

As there is a new pre-release... Can I have a quick feedback and state on this?

@WayneD
Copy link
Member

WayneD commented May 1, 2023

The current release only has bugfixes in the main code (it's only the adjunct scripts & manpages that got enhancements).

I'm very cautious in making output-affecting changing, but will be giving this a closer look.

@eworm-de
Copy link
Contributor Author

eworm-de commented May 2, 2023

I can understand you are cautious about making output-affecting changing, guess this is due to breaking scripts that expect specific output?
My changes effect human readable output only, though. 😉 I hope this will not break anything.

@tridge
Copy link
Member

tridge commented Apr 6, 2024

@eworm-de could you add a description of the before and after of what this change does? Needs a bit more context than "improve" :-)

@eworm-de
Copy link
Contributor Author

eworm-de commented Apr 6, 2024

The commit messages have the details. Are you missing something there or just here in the pull request?

@eworm-de eworm-de force-pushed the human branch 2 times, most recently from 933dc1f to 75ea671 Compare April 7, 2024 18:01
@eworm-de
Copy link
Contributor Author

eworm-de commented Apr 7, 2024

This is the output of git log master..:

commit 75ea671e822b347cd4a6656d9913eb9fa89ff600 (HEAD -> human)
Author: Christian Hesse <[email protected]>
Date:   Thu Mar 23 10:33:33 2023 +0100

    human-readable: add an "i" to unit to indicate binary (1024) base

commit 4f215ad2cf7b0dff74db74202412793a9947cadb
Author: Christian Hesse <[email protected]>
Date:   Wed Mar 22 11:07:15 2023 +0100

    human-readable: also handle num < mult with the same code
    
    ... just make sure no precision is added.

commit d4784655035dcfdf02efb30164b181f47546713b
Author: Christian Hesse <[email protected]>
Date:   Tue Mar 21 10:17:09 2023 +0100

    human-readable: use dynamic precision length
    
    Let's lower precision for huge numbers.
    
    The output used to be:
    
      3.45M -> 46.73M -> 523.11M -> 1.24G -> ...
    
    With this change the code always gives the three most significant digits:
    
      3.45M -> 46.7M -> 523M -> 1.24G -> ...

commit 53e4e68e9d5d195679db74e178c4d9e915094236
Author: Christian Hesse <[email protected]>
Date:   Tue Mar 21 10:13:47 2023 +0100

    human-readable: calculate numbers in a loop
    
    This drops a lot of `else if` blocks and extends units
    by "E", "Z" & "Y".

@tridge
Copy link
Member

tridge commented Apr 7, 2024

@eworm-de ok, thanks, I normally expect it in the PR message
@WayneD are we concerned about users having parses these messages? Also, should we have a unit test for this?

@eworm-de eworm-de force-pushed the human branch 3 times, most recently from 0ca5744 to 6abcd9b Compare April 9, 2024 07:06
@eworm-de
Copy link
Contributor Author

eworm-de commented Apr 9, 2024

Just added another commit:

commit 7f26b1d2dd34ec39a566d0ba42a43bf22d6d5c46 (HEAD -> human, origin/human)
Author: Christian Hesse <[email protected]>
Date:   Tue Apr 9 09:56:39 2024 +0200

    human-readable: also use it to format rate
    
    Let's also simplify the code for rate in progress, and benefit from
    same functionality.

@eworm-de eworm-de force-pushed the human branch 2 times, most recently from a20c3e6 to cb0b932 Compare April 11, 2024 06:31
@eworm-de
Copy link
Contributor Author

are we concerned about users having parses these messages?

I still stand by my point: This is about human readable output. We should not be worried too much about compatibility with parsers.

@eworm-de
Copy link
Contributor Author

Any news on this? Does it help if I split this across several pull requests?

This drops a lot of `else if` blocks and extends units
by "E", "Z" & "Y".
Let's lower precision for huge numbers.

The output used to be:

  3.45M -> 46.73M -> 523.11M -> 1.24G -> ...

With this change the code always gives the three most significant digits:

  3.45M -> 46.7M -> 523M -> 1.24G -> ...
... just make sure no precision is added.
Let's also simplify the code for rate in progress, and benefit from
same functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants