-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
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.
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.
I think, both uint64_t
and size_t
would be fine. No need to change this.
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
f2ae109
to
f68af1e
Compare
@ShaiMagal: Have you tested the PR? |
@natoscott When this PR will be merged? It's "game changer" for overall about disk activity :) Should it be merged sooner than in 3.4.0? |
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.
Aside from some minor cleanup stuff the PR LGTM.
@ShaiMagal Please confirm whether you have tested these changes.
@Explorer09 Mind to include these minor cleanups? Just throw in an extra patch with the consistency cleanup stuff and I think we are fine.
@@ -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.
I think, both uint64_t
and size_t
would be fine. No need to change this.
152412b
to
64efa16
Compare
ddc3679
to
d6d8f0a
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]>
Change the data type from unsigned long long to uint64_t. Co-authored-by: Benny Baumann <[email protected]>
d6d8f0a
to
becb032
Compare
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.