It is currently March 28th, 2024, 9:15 pm

Fixing problems with UsageMonitor plugin

Our most popular Tips and Tricks from the Rainmeter Team and others
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Fixing problems with UsageMonitor plugin

Post by jsmorley »

If you are using the UsageMonitor plugin, or either of the PerfMon or AdvancedCPU plugins in your skin, be aware that they use the information being collected by the Performance Monitor (Perfmon.exe) process in Windows.

While rare, there can be issues with Performance Monitor that can cause these plugins to fail to return valid information.

Performance Counters disabled in the Windows Registry

Using RegEdit.exe, check the following Registry Key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance

It should look something like this:
1.png
In particular, ensure that Disable Performance Counters is not set to "1". This must be set to "0" for Performance Monitor to do its job.

By default this is "0" or "enabled" (or most likely not there at all, which is fine) when Windows is installed, but who knows, you may have turned it off inadvertently, or run one of those hideous "tune up your PC" malware utilities that everyone should avoid like poison.

Corrupted Performance Monitor counters database

Run cmd.exe, being sure to run "As administrator". In Windows 10, just right-click the Start button:
2.png
At the command line, enter the following commands in order:
cd c:\windows\system32
lodctr /R
cd c:\windows\sysWOW64
lodctr /R
You should see the following results:

Info: Successfully rebuilt performance counter setting from system backup store
3.png
If you get an error message instead, you can often correct this by running the command a second time.

Note: You can also run any of these commands in PowerShell, just be sure to run "As administrator".
1.png
Corrupted system files

It is possible that one or more system files in Windows have gotten corrupted. This can be corrected by again opening an "As administrator" command prompt, and run sfc (System File Checker) with the following command:
sfc /scannow
5.png
Note that this can take 15-20 minutes to complete. If sfc finds and corrects any errors, you should always run it a second time to verify that no further errors are detected.

Reboot your PC, and give the UsageMonitor, AdvancedCPU, or PerfMon plugins another try. Chances are good that one of these solutions has corrected the issue.

Here is a test skin you can use. It will show the percentage of CPU usage for the process "Rainmeter", using the UsageMonitor, AdvancedCPU, and PefMon plugins. Note that all of them are accurate, but that UsageMonitor is using its own, internal interval for when it checks the counters, and may not be synchronized with AdvancedCPU or PerfMon.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

; ===================
; UsageMonitor Plugin
; ===================

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

[MeterUsageMonitorRainmeterPercent]
Meter=String
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Percentual=1
NumOfDecimals=2
DynamicVariables=1
Text=[UsageMonitorRainmeter]	[UsageMonitorRainmeter:2]%

; ===================
; AdvancedCPU Plugin
; ===================

[AdvancedCPUMaxValue]
Measure=Plugin
Plugin=AdvancedCPU

[AdvancedCPURainmeterUse]
Measure=Plugin
Plugin=AdvancedCPU
CPUInclude=Rainmeter
TopProcess=1
MaxValue=[AdvancedCPUMaxValue]
DynamicVariables=1

[AdvancedCPURainmeterName]
Measure=Plugin
Plugin=AdvancedCPU
CPUInclude=Rainmeter
TopProcess=2

[MeterAdvancedCPURainmeterPercent]
Meter=String
Y=5R
MeasureName=AdvancedCPURainmeterUse
MeasureName2=AdvancedCPURainmeterName
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Percentual=1
NumOfDecimals=2
Text=%2	%1%

; ===================
; Perfmon Plugin
; ===================

[PerfmonMaxValue]
Measure=Plugin
Plugin=PerfMon
PerfMonObject=Process
PerfMonCounter=% Processor Time
PerfMonInstance=_Total
PerfMonDifference=1

[PerfmonRainmeterUse]
Measure=Plugin
Plugin=PerfMon
PerfMonObject=Process
PerfMonCounter=% Processor Time
PerfMonInstance=Rainmeter
PerfMonDifference=1
MaxValue=[PerfmonMaxValue]
DynamicVariables=1

[MeterPerfmonRainmeterPercent]
Meter=String
MeasureName=PerfmonRainmeterUse
Y=5R
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Percentual=1
NumOfDecimals=2
Text=Rainmeter	%1%
4.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: Fixing problems with PerfMon or AdvancedCPU plugins

Post by tjhrulz »

Just as a reminder all of this also applies to the new UsageMonitor plugin as well since that also uses the Windows Performance Monitor to get its info.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fixing problems with UsageMonitor plugin

Post by jsmorley »

tjhrulz wrote:Just as a reminder all of this also applies to the new UsageMonitor plugin as well since that also uses the Windows Performance Monitor to get its info.
Updated the text and the test skin to reflect this...
DeltaYoshi
Posts: 1
Joined: May 7th, 2022, 6:31 am

Re: Fixing problems with UsageMonitor plugin

Post by DeltaYoshi »

I am so thankful that I found this post :thumbup: . Solved my problem with Win11 that all of a sudden Rainmeter kept crashing because of external plugins. Not even restoring a 2 week old full backup from drive C: helped :confused: .
MORBID21
Posts: 1
Joined: January 15th, 2024, 3:29 pm

Re: Fixing problems with UsageMonitor plugin

Post by MORBID21 »

I registered just to thank you.
So Thank You
cpu cores usage wasnt working and also top ram and top cpu processes