-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
Meter_humanUnit() rewrite and *IOMeter code improvements #1321
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Explorer09
commented
Nov 1, 2023
Explorer09
force-pushed
the
meter-human-unit
branch
from
November 1, 2023 11:52
855327f
to
628f407
Compare
Explorer09
changed the title
Meter_humanUnit() rewrite and other code quality improvements
Meter_humanUnit() rewrite and *IOMeter code improvements
Nov 1, 2023
Explorer09
force-pushed
the
meter-human-unit
branch
from
November 1, 2023 12:37
628f407
to
d31cbf7
Compare
natoscott
reviewed
Nov 1, 2023
Explorer09
force-pushed
the
meter-human-unit
branch
from
November 5, 2023 06:04
d31cbf7
to
6ec86f5
Compare
BenBE
reviewed
Nov 5, 2023
Explorer09
force-pushed
the
meter-human-unit
branch
from
November 8, 2023 06:44
6ec86f5
to
d184f06
Compare
Explorer09
force-pushed
the
meter-human-unit
branch
2 times, most recently
from
November 10, 2023 04:55
e308f76
to
965b143
Compare
BenBE
reviewed
Nov 10, 2023
BenBE
added
enhancement
Extension or improvement to existing feature
code quality ♻️
Code quality enhancement
labels
Nov 10, 2023
Explorer09
force-pushed
the
meter-human-unit
branch
3 times, most recently
from
November 12, 2023 15:39
c70be03
to
ebadab8
Compare
When `cached_utilisation_diff` is capped, it would never be greater than `DiskIOMeter.total`. Signed-off-by: Kang-Che Sung <[email protected]>
Always update the `values` member during the call of DiskIOMeter_updateValues(). This makes the values of every instance of DiskIOMeter consistent. The user might see non-zero bars (or graph) during the "stale" status of the meter after this commit. The side effect is not a bug. Signed-off-by: Kang-Che Sung <[email protected]>
Always update the `values` member during the call of NetworkIOMeter_updateValues(). This makes the values of every instance of NetworkIOMeter consistent. The user might see non-zero bars (or graph) during the "stale" status of the meter after this commit. The side effect is not a bug. Signed-off-by: Kang-Che Sung <[email protected]>
Since Meter_humanUnit() is often called with floating point values in Meter objects, rewrite the function to let it process `double` type natively, and save floating point to integer casts. The rewritten function: * Allows higher orders of magnitude including 'R' and 'Q', and addresses infinity. (The previous version has a maximum value of (2^64 - 1) representing 16 ZiB.) * Rounds values when they are in intervals (99.9, 100) and (9.99, 10), and displays them with correct precision (number of fraction digits). * Produces assertion error on negative and NaN values (undefined behavior). Signed-off-by: Kang-Che Sung <[email protected]>
In DiskIOMeter, the number strings of bytes per second are formatted with Meter_humanUnit(). As the numbers are only updated every 500 ms, it is good to cache the formatted strings. This saves code size. Signed-off-by: Kang-Che Sung <[email protected]>
In NetworkIOMeter, the number strings of bytes per second are formatted with Meter_humanUnit(). As the numbers are only updated every 500 ms, it is good to cache the formatted strings. This saves code size. Signed-off-by: Kang-Che Sung <[email protected]>
Explorer09
force-pushed
the
meter-human-unit
branch
from
November 22, 2023 18:47
ebadab8
to
63cf063
Compare
Signed-off-by: Kang-Che Sung <[email protected]>
Improve precisions when drawing in bar meter mode. Signed-off-by: Kang-Che Sung <[email protected]>
Explorer09
force-pushed
the
meter-human-unit
branch
from
November 22, 2023 19:13
63cf063
to
ba6d656
Compare
natoscott
approved these changes
Nov 23, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Explorer09 @BenBE LGTM, thanks.
BenBE
approved these changes
Nov 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Meter_humanUnit()
to make it work withdouble
(floating point) values.DiskIOMeter
andNetworkIOMeter
code improvements to work with the newMeter_humanUnit()
function. See commit description for details.