It is currently March 28th, 2024, 6:36 pm

[BUG] UsageMonitor occasionally reports too high CPU usage for individual processes

Report bugs with the Rainmeter application and suggest features.
Post Reply
MaygeKyatt
Posts: 1
Joined: July 10th, 2018, 12:15 am

[BUG] UsageMonitor occasionally reports too high CPU usage for individual processes

Post by MaygeKyatt »

When I discovered the new UsageMonitor plugin, I immediately started playing around with it. One of the first things I tried to make was a bar meter that showed total CPU usage (using Alias=CPU), and had colored regions within it showing how much of that usage was caused by each of the top 5 processes (using the Index= option). For the most part, the skin seems to work fine. However, it will occasionally find values for those 5 top processes which add up to more than the total usage (reported by Index=0). This always only lasts until the next time the skin updates, at which point all the values return to believable levels.

The incorrect results vary wildly from occurrence to occurrence. Sometimes, the reported total is higher than any individual process, but is lower than the sum of the first 5 indexed programs (for example, Index=0 might report 55% total usage, while Index=1-5 sums to a value closer to 62%). Other times (and this actually seems to be the more common occurrence), the total usage with be reported as 100%, and at least one of the individual processes will also show at 100% usage, with the remaining processes all showing values considerably larger than the 0% they would need for that to make sense. Once, I even managed to capture Rainmeter reporting 100% usage for ALL FIVE of the individual processes I was tracking.

Image

One thing I have noticed is that the Index=0 (total) value is never less than any of the individual process values (although it can be equal, as I said above, when both the total and some of the processes report 100%). It's only when you add together the process values that they exceed the "total".

This error seems to occur most often when there are several processes using moderate amounts of CPU and one of them suddenly spikes (ex. when I reload a tab in Chrome while my PC backup program is running in the background), although this does not always cause it to occur. This error seems to most often occur when Chrome is the program at Index=1, but that is likely just because Chrome is the program that most often occupies that slot while I am working. The erroneous results appear regardless of whether the Rollup= option is set to 0 or 1. I have been seeing this error for the past several versions (ever since I updated to 4.2), and it is still present in the 4.2 Final Release version. I have even tried rebuilding the performance counter database using the instructions on the UsageMonitor documentation page, which seemed to have no effect on the issue.
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth
Contact:

Re: [BUG] UsageMonitor occasionally reports too high CPU usage for individual processes

Post by tjhrulz »

I replied on the issue you made on github since raiguard had commented there but just to redo my post here:

There really is 3 different bugs here so to give my take on each:

1. Total < Top Processes - Not sure on this one, if I had to guess maybe you are really unlucky and the list may be swapped out part way through your skin update. This should be pretty hard to have happen but in a more complex skin it may be more likely, which may be why I have not been able to recreate it. I will look into trying to prevent that from happening (Although it will be hard)

2. Spikes to 100% - Clearly some invalid/old/missing data is messing up the translation from CPU time to %, willing to be if I took off the 100% cap we would find it is much higher than 100%. I know you had mentioned you had tested parts with rollup off and on but specifically does this still occur with Rollup=0?

3. Spikes higher than task manager - This is nothing to worry about, UsageMonitor and Task Manager are both snapshots in time so a spike being much higher in one is not impossible (Although it may in part be due to whatever is causing issue 2). Also note that Task Manager seems to do a lot of processing to its results in the process tab and looking at the details tab is more accurate.

Also any chance you two could upload your skins you are using to test this and also list what your computer's CPU is as I have yet to reproduce or see one of these on my systems
Post Reply