It is currently April 19th, 2024, 9:45 am

CPU usage of processes

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

CPU usage of processes

Post by balala »

Another question I couldn't find the answer to, so here I am again.
I have more UsageMonitor plugin measures, which are returning the CPU usage of different processes:

Code: Select all

[MeasureHighestCPU1]
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Index=1
Blacklist=_Total|Idle|Memory Compression

[MeasureHighestCPU2]
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Index=2
Blacklist=_Total|Idle|Memory Compression 

...
Recently I had access to a system running Windows 11. I found that what the skin using the above measures is showing is extremely different from what I can see in Windows 's Task Manager. Some smaller differences were on Windows 10 as well (which I'm using currently), however on Windows 11 the differences seem to be much higher.
My question is if anyone knows a way on how the values reported by the skin can be done to match the values shown in the Task Manager. My question is related to both systems: Windows 10 and Windows 11.
Thanks in advance to anyone having a good idea (or even better, a solution).
User avatar
xenium
Posts: 865
Joined: January 4th, 2018, 9:52 pm

Re: CPU usage of processes

Post by xenium »

balala wrote: March 14th, 2023, 6:33 pm Another question I couldn't find the answer to, so here I am again.
I have more UsageMonitor plugin measures, which are returning the CPU usage of different processes:

Code: Select all

[MeasureHighestCPU1]
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Index=1
Blacklist=_Total|Idle|Memory Compression

[MeasureHighestCPU2]
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Index=2
Blacklist=_Total|Idle|Memory Compression 

...
Recently I had access to a system running Windows 11. I found that what the skin using the above measures is showing is extremely different from what I can see in Windows 's Task Manager. Some smaller differences were on Windows 10 as well (which I'm using currently), however on Windows 11 the differences seem to be much higher.
My question is if anyone knows a way on how the values reported by the skin can be done to match the values shown in the Task Manager. My question is related to both systems: Windows 10 and Windows 11.
Thanks in advance to anyone having a good idea (or even better, a solution).
See this post by SilverAzide:
https://forum.rainmeter.net/viewtopic.php?p=211479&sid=a3d8051a495e2e334c68648a9605329e&hilit=quote+enclose+option#p211479
User avatar
SilverAzide
Rainmeter Sage
Posts: 2603
Joined: March 23rd, 2015, 5:26 pm

Re: CPU usage of processes

Post by SilverAzide »

balala wrote: March 14th, 2023, 6:33 pm Another question I couldn't find the answer to, so here I am again.
I have more UsageMonitor plugin measures, which are returning the CPU usage of different processes:

Recently I had access to a system running Windows 11. I found that what the skin using the above measures is showing is extremely different from what I can see in Windows 's Task Manager. Some smaller differences were on Windows 10 as well (which I'm using currently), however on Windows 11 the differences seem to be much higher.
My question is if anyone knows a way on how the values reported by the skin can be done to match the values shown in the Task Manager. My question is related to both systems: Windows 10 and Windows 11.
Thanks in advance to anyone having a good idea (or even better, a solution).
This is known behavior. It actually changed in Win 11 22H2; it was OK in earlier versions of Windows 11. I've posted about this extensively:

New computer on intel 13th gen W11 (CPU Usage is wrong)
[Bug] Skins show lower than actual CPU Usage in Windows 11 22H2

In summary, the old CPU measure and the UsageMonitor with the CPU alias no longer work as they used to. You will need to change any of these measures as mentioned in my posts to use the utility-based counters instead of time-based counters.

The bad news is that -- so far -- there is no way I know of to fix the "top process" type measures because these are all based on CPU time, not CPU utility. As a result, the measures return data that is not the same as what you saw before.

Welcome to Windows 11! :x
Gadgets Wiki GitHub More Gadgets...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2603
Joined: March 23rd, 2015, 5:26 pm

Re: CPU usage of processes

Post by SilverAzide »

D'oh! You beat me to it! LOL
Gadgets Wiki GitHub More Gadgets...
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: CPU usage of processes

Post by balala »

SilverAzide wrote: March 14th, 2023, 7:55 pm This is known behavior. It actually changed in Win 11 22H2; it was OK in earlier versions of Windows 11. I've posted about this extensively:

New computer on intel 13th gen W11 (CPU Usage is wrong)
[Bug] Skins show lower than actual CPU Usage in Windows 11 22H2
I see. Good to know. Thank you both for the replies and for the links. Will have to study them a little bit closer.
SilverAzide wrote: March 14th, 2023, 7:55 pm In summary, the old CPU measure and the UsageMonitor with the CPU alias no longer work as they used to. You will need to change any of these measures as mentioned in my posts to use the utility-based counters instead of time-based counters.

The bad news is that -- so far -- there is no way I know of to fix the "top process" type measures because these are all based on CPU time, not CPU utility. As a result, the measures return data that is not the same as what you saw before.
Too bad! Damn MS...
SilverAzide wrote: March 14th, 2023, 7:55 pm Welcome to Windows 11! :x
I'm not yet on Win 11, just as said, had access recently to one. But for now, me personally will no be there too soon. However once will be needed to switch, I think...
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: CPU usage of processes

Post by CodeCode »

balala wrote: March 14th, 2023, 8:10 pm ...Damn MS...

I'm not yet on Win 11, just as said, had access recently to one. But for now, me personally will no be there too soon. However once will be needed to switch, I think...
No doubt the actual real need to change will likely be longer than the prospective release of Windows 12. --- we hope --- :confused:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Yincognito
Rainmeter Sage
Posts: 7125
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: CPU usage of processes

Post by Yincognito »

Hey there - greetings from the wonderful, bug free, stable world of Windows ... 10! 8-)
As somebody who always waits around 4 years until switching to a MS product, I can safely say: "I told you so..." :twisted:
That's what you get for wanting round corners and all kinds of fancy TPM. :???:
Windows 7 will be like: wink, wink! Oh, the good ol' days...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7125
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: CPU usage of processes

Post by Yincognito »

SilverAzide wrote: March 14th, 2023, 7:55 pm This is known behavior. It actually changed in Win 11 22H2; it was OK in earlier versions of Windows 11.

In summary, the old CPU measure and the UsageMonitor with the CPU alias no longer work as they used to. You will need to change any of these measures as mentioned in my posts to use the utility-based counters instead of time-based counters.

The bad news is that -- so far -- there is no way I know of to fix the "top process" type measures because these are all based on CPU time, not CPU utility. As a result, the measures return data that is not the same as what you saw before.
Well, I've been fiddling with some of the code from the skins of my suite recently, and I discovered this:

Code: Select all

[Variables]

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures---

[RainmeterCPUAlias]
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Name=Rainmeter

[RainmeterCPUCounter]
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=% Processor Time
Name=Rainmeter

---Meters---

[Results]
Meter=String
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
Text="Rainmeter CPU Usage   (Alias) = [RainmeterCPUAlias:]#CRLF#Rainmeter CPU Usage (Counter) = [RainmeterCPUCounter:]"
DynamicVariables=1
Alias vs Counter.jpg
Mind you, this is on Windows 10, not Windows 11. The question is, unless I'm missing the obvious here, shouldn't these two forms of getting the CPU usage of a process return the same value, since, according to the manual, the Alias=CPU is just another way of writing Category=Process and Counter=% Processor Time for the said process? I mean, the difference is too significant to be caused by (hypothetical) different moments of getting the data, and at least one such comparison in the past (not sure what the code was, but the "by alias" vs "by counter" lines in the screenshot are self explanatory) seemed to yield the same values...

So, what am I missing (if I'm missing something, that is)? Is it a bug? Can this be used to "correct" the lower CPU usage of processes on Windows 11, if by any chance those lower values were caused by using the alias and not the plain counter? SilverAzide, you dealt with such things in your suite, both on Win 10 and Win 11, so what do you think about it? Did you notice this? :???:

Everyone else, can you replicate this? If so, what are your thoughts about it?

P.S. The funny thing is that, while PerfMon.msc presents the (higher) counter value, the Win 10 Task Manager seems to prefer the (lower) alias one. Maybe in Win 11 its Task Manager finally presents the former instead?
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2603
Joined: March 23rd, 2015, 5:26 pm

Re: CPU usage of processes

Post by SilverAzide »

Yincognito wrote: May 8th, 2023, 9:10 am So, what am I missing (if I'm missing something, that is)? Is it a bug? Can this be used to "correct" the lower CPU usage of processes on Windows 11, if by any chance those lower values were caused by using the alias and not the plain counter? SilverAzide, you dealt with such things in your suite, both on Win 10 and Win 11, so what do you think about it? Did you notice this? :???:

Everyone else, can you replicate this? If so, what are your thoughts about it?

P.S. The funny thing is that, while PerfMon.msc presents the (higher) counter value, the Win 10 Task Manager seems to prefer the (lower) alias one. Maybe in Win 11 its Task Manager finally presents the former instead?
You had me worried there for a minute... :) You have an omission in your [RainmeterCPUCounter]. Add the line Percent=1 to the measure and you'll see the two measures will now report identical data:
Screenshot 2023-05-08 080733.png
The CPU alias sets this value to 1 for you, but when not using the alias, you have to do it yourself. What you are seeing in PerfMon is the process time percentage. but it is not taking into account the total percentage of ALL processes. This is why you were seeing Task Manager match Rainmeter's CPU alias (the "Rainmeter percentage" of the "total percentage").
You do not have the required permissions to view the files attached to this post.
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7125
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: CPU usage of processes

Post by Yincognito »

SilverAzide wrote: May 8th, 2023, 12:18 pm You had me worried there for a minute... :) [...]
Ah, that explains it, thanks - was sure I missed something in the measure! Although... the Rainmeter percentage of all processes should be greater than its percentage of the total CPU, if that makes sense, right? Meaning raw PerfMon provides the former, while Task Manager provides the latter. So why needing the Percent=1 then? :???:

Anyway, just curious, how does the UsageMonitor measure value without Percent=1 compare to Windows 11 reporting in Task Manager? Is there any similarity whatsoever?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth