Skip to content

Fix CPU virtualization bar color and help text in non-detailed mode#1921

Open
natoscott wants to merge 1 commit intohtop-dev:mainfrom
natoscott:fix-cpu-bar-virt-color
Open

Fix CPU virtualization bar color and help text in non-detailed mode#1921
natoscott wants to merge 1 commit intohtop-dev:mainfrom
natoscott:fix-cpu-bar-virt-color

Conversation

@natoscott
Copy link
Member

The overlaying of CPU virt times (guest+steal) into the IRQ slot is problematic when displaying CPU time in bar mode. It results in the IRQ color being used for virt, which doesn't match up with the Help text for CPU util when in the non-detailed CPU time mode. The text 'guest' displayed on the Help window is also misleading because the value is actually the sum of guest+steal time - use 'virt' instead, to indicate this is not guest time only.

Resolves #1920

The overlaying of CPU virt times (guest+steal) into the IRQ slot is
problematic when displaying CPU time in bar mode. It results in the
IRQ color being used for virt, which doesn't match up with the Help
text for CPU util when in the non-detailed CPU time mode.  The text
'guest' displayed on the Help window is also misleading because the
value is actually the sum of guest+steal time - use 'virt' instead,
to indicate this is not guest time only.

Resolves htop-dev#1920
@Explorer09
Copy link
Contributor

Changing the attributes of CPUMeter during the middle of htop running can break graph display (perhaps you won't see it until the color graph (#714) mode feature is added).

Another problem is there is a time discrepancy between updating the settings and the actual CPU time is refetched. So there could be a short time frame that the CPUMeter data is desynchronized.

@BenBE BenBE added the bug 🐛 Something isn't working label Mar 16, 2026
@natoscott
Copy link
Member Author

Changing the attributes of CPUMeter during the middle of htop running can break graph display (perhaps you won't see it until the color graph (#714) mode feature is added).

That PR is already broken then, as this is how the Load Average meter works already.

Another problem is there is a time discrepancy between updating the settings and the actual CPU time is refetched. So there could be a short time frame that the CPUMeter data is desynchronized.

That may be a different bug (I doubt it TBH), but its not relevant to the (color, not value) fix here.

@Explorer09
Copy link
Contributor

I would like you to review and comment on #1922 which is my approach to the problem.

Changing the attributes of CPUMeter during the middle of htop running can break graph display (perhaps you won't see it until the color graph (#714) mode feature is added).

That PR is already broken then, as this is how the Load Average meter works already.

Not quite. The Load Average meter still works with #714 because the color change only affects bar display and not graph display at all.

@natoscott
Copy link
Member Author

I would like you to review and comment on #1922 which is my approach to the problem.

I prefer the simpler fix proposed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐛 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Help is missing description of orange-colored CPU bar

3 participants