-
-
Notifications
You must be signed in to change notification settings - Fork 442
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
Normalize DiskIOMeter bar by number of disks #1533
base: main
Are you sure you want to change the base?
Conversation
Something like this patch will provide the PCP value you seek. You might want to consider a similar change for the NetworkIOMeter, in which case there is a "hinv.ninterface" metric that can be used similarly.
|
@natoscott There is no "utilization percentage" for NetworkIOMeter at the moment. So I would consider showing the number of interfaces a feature separate from this pull request. |
Understood & agreed. FWIW, I think this approach is not ideal (shares the same problem of the original 100% limiting, as mentioned by the reporter of #1374 - the code was fine the way it was originally). We need to be aware here of properties of some hardware described in the iostat(1) man page ...
|
@natoscott What was the ideal approach anyway? |
Just reverting to the original htop behaviour as the issue reporter suggested. |
@natoscott Look in my patch carefully. I separated the utilization value into two. |
55b5d1e
to
76eac73
Compare
@@ -16,6 +16,7 @@ typedef struct DiskIOData_ { | |||
uint64_t totalBytesRead; | |||
uint64_t totalBytesWritten; | |||
uint64_t totalMsTimeSpend; | |||
uint64_t numDisks; |
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.
Should the data type be unsigned int
, size_t
, uint64_t
or unsigned long long
?
Should the property be named "numDisks" or "nDisks"?
Other than those questions, this patch is ready.
Two thumbs up - good stuff, thanks. Regarding your data type question, I think I know what @BenBE is going to suggest: size_t FTW. :) However, systems with more than 4 billion disks are few and far between so I'm sure a 32 bit unsigned value would suffice. If noone has strong opinions, I suggest sticking with what you have now since that's consistent with the surrounding code. |
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.
For PCP this would require a downcast from |
76eac73
to
5927d8b
Compare
FWIW, for PCP to use 32-bit types we would change this section:
to
but, keep it as you have it, it's fine IMO. |
595606e
to
03a8e22
Compare
03a8e22
to
f2ae109
Compare
The utilization percentage of DiskIOMeter is an accumulated total of all disks, and for multiple disks, utilization above 100% is possible. The maximum utilization should be "100% * number of disks". Set the bar and graph of the meter to draw with that maximum. Thanks to Nathan Scott for providing the PCP portion of the patch. Resolves htop-dev#1374. Co-authored-by: Nathan Scott <[email protected]> Signed-off-by: Kang-Che Sung <[email protected]>
f2ae109
to
f68af1e
Compare
When this PR will be merged? It's "game changer" for overall about disk activity :) |
@ShaiMagal: Have you tested the PR? |
The maximum utilization should be "100% * number of disks". Set the bar and graph of the meter to draw with that maximum. Also remove the 100% cap on the utilization percentage display.
Resolves #1374.