[CmdPal][PerfMon] Use % Processor Time for system CPU dock#47864
Open
Knyrps wants to merge 1 commit into
Open
Conversation
The system-wide CPU counter used `% Processor Utility`, which is scaled by `% Processor Performance` and is intentionally unbounded above 100% when cores boost above their nominal base frequency. Under load this produced values like 144% in the dock. Switch to `% Processor Time` — the same counter Task Manager renders — which is naturally bounded to 0-100%. The per-process branch is unaffected; it already divides by `Environment.ProcessorCount` and continues to use `% Processor Time`. Fixes microsoft#46381
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of the Pull Request
The system-wide CPU counter in the Command Palette Performance monitor used
% Processor Utility, which is scaled by% Processor Performanceand is intentionally unbounded above 100% when cores boost above their nominal base frequency. Under load this produced values like 144% in the dock, as reported in #46381.Switch to
% Processor Time— the same counter Task Manager renders — which is naturally bounded to 0-100%.The per-process branch is unaffected; it already divides by
Environment.ProcessorCountand continues to use% Processor Time, so individual process readings remain correct.PR Checklist
Microsoft.CmdPal.Ext.PerformanceMonitorand the fullCommandPalette.slnf(Debug|x64). Verified the built DLL contains% Processor Timeand no longer contains% Processor Utility.Detailed Description of the Pull Request / Additional comments
% Processor Utilityis documented by Microsoft as deliberately unbounded; it represents an "effective" utilization that accounts for turbo/boost frequencies. It is well-suited for billing/capacity contexts but not for a "% of CPU used" UI element where users expect a 0-100% reading consistent with Task Manager and Resource Monitor._procPerformance(the% Processor Performancecounter) is retained because it is still used byCpuSpeedto compute the live frequency display, so removing it would regress the speed readout.Before
System CPU dock showed values >100% under load (reported 144% in the issue).
After
System CPU dock is bounded to 0-100%, matching Task Manager.