It is currently February 25th, 2020, 9:54 am

A Bug about the UsageMonitor plugin

Report bugs with the Rainmeter application and suggest features.
User avatar
Lssg97
Posts: 13
Joined: October 21st, 2018, 2:55 am

A Bug about the UsageMonitor plugin

Post by Lssg97 »

Hello everyone!

I'm recently working on a skin that monitors the working state of the GPU. I found a Bug while using the UsageMonitor plugin. The general situation is: if there are two skins using the UsageMonitor plugin, one of them defines PIDToName=1 and the other skin defines
PIDToName=0. When these two skins work at the same time, the definition of the skin opened later will be consistent with the skin opened first, ignoring its own definition.

Details are as follows:
I used the template provided in the Rainmeter Documentation for the demonstration.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
SkinWidth=360
BackgroundMode=2
SolidColor=0,0,0,1

[Variables]
Browser=firefox
;Browser=chrome

[MeasureCPU]
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Index=0

[MeasureMyApps]
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Index=1
Whitelist=Rainmeter|#Browser#|hexchat|CCleaner64

[MeasureTop1byAlias]
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Index=1
Blacklist=_Total|Idle|dwm|wmpnetwk|csrss|svchost|lsass|System|system|Memory Compression|wininit|RemindersServer|spoolsv|IpOverUsbSvc

[MeasureTop1byCounter]
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=% Processor Time
Index=1
Percent=1
Blacklist=_Total|Idle|dwm|wmpnetwk|csrss|svchost|lsass|System|system|Memory Compression|wininit|RemindersServer|spoolsv|IpOverUsbSvc

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

[MeasureBrowser]
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Name=#Browser#

[TotalThreads]
Measure=Plugin
Plugin=UsageMonitor
Category=System
Counter=Threads
Index=0

[Core0Usage]
Measure=Plugin
Plugin=UsageMonitor
Category=Processor
Counter=% Processor Time
Name=0
MinValue=0
MaxValue=100

[Core1Usage]
Measure=Plugin
Plugin=UsageMonitor
Category=Processor
Counter=% Processor Time
Name=1
MinValue=0
MaxValue=100

[TopGPU]
Measure=Plugin
Plugin=UsageMonitor
Alias=GPU
Index=1
MinValue=0
MaxValue=100
Blacklist=dwm|csrss

[TotalVRAM]
Measure=Plugin
Plugin=UsageMonitor
Alias=VRAM
Index=0
MinValue=0
MaxValue=4831838208

[TotalVRAMScaled]
Measure=Calc
Formula=TotalVRAM

[RainmeterIO]
Measure=Plugin
Plugin=UsageMonitor
Alias=IO
Name=Rainmeter

[RainmeterIOScaled]
Measure=Calc
Formula=RainmeterIO

[TopIORead]
Measure=Plugin
Plugin=UsageMonitor
Alias=IO
Index=1

[TopIOReadScaled]
Measure=Calc
Formula=TopIORead

[BrowserIOWrite]
Measure=Plugin
Plugin=UsageMonitor
Alias=IOWrite
Name=#Browser#

[BrowserIOWriteScaled]
Measure=Calc
Formula=BrowserIOWrite

[BrowserRAM]
Measure=Plugin
Plugin=UsageMonitor
Alias=RAM
Name=#Browser#

[BrowserRAMScaled]
Measure=Calc
Formula=BrowserRAM

[NetworkIn]
Measure=Plugin
Plugin=UsageMonitor
Category=Network Adapter
Counter=Bytes Received/sec
Index=1

[NetworkInScaled]
Measure=Calc
Formula=NetworkIn
IfAboveValue=0
IfAboveAction=[!SetOption MeterNetworkName Text "[NetworkIn]"][!UpdateMeter *][!Redraw]

[NetworkOut]
Measure=Plugin
Plugin=UsageMonitor
Category=Network Adapter
Counter=Bytes Sent/sec
Index=1

[NetworkOutScaled]
Measure=Calc
Formula=NetworkOut
IfAboveValue=0
IfAboveAction=[!SetOption MeterNetworkName Text "[NetworkOut]"][!UpdateMeter *][!Redraw]

; Meters

[AllStyle]
FontSize=11
FontWeight=400
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1

[RightStyle]
X=360
StringAlign=Right

[MeterCPULabel]
Meter=String
MeterStyle=AllStyle
Text=Total CPU Usage

[MeterCPUValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Text=[MeasureCPU] : [MeasureCPU:1]%

[MeterMyAppsLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Top MyApps

[MeterMyAppsValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[MeasureMyApps] : [MeasureMyApps:1]%

[MeterTop1byAliasLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Top Process by Alias

[MeterTop1byAliasValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[MeasureTop1byAlias] : [MeasureTop1byAlias:1]%

[MeterTop1byCounterLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Top Process by Counter

[MeterTop1byCounterValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[MeasureTop1byCounter] : [MeasureTop1byCounter:1]%

[MeterRainmeterLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Rainmeter CPU

[MeterRainmeterValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[MeasureRainmeter] : [MeasureRainmeter:1]%

[MeterBrowserLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Browser CPU

[MeterBrowserValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[MeasureBrowser] : [MeasureBrowser:1]%

[MeterTotalThreadsLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Total Threads

[MeterTotalThreadsValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[TotalThreads] : [TotalThreads:0]

[MeterCore0UsageLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=CPU Core 0 Usage

[MeterCore0UsageValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[Core0Usage] : [Core0Usage:1]%

[MeterCore1UsageLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=CPU Core 1 Usage

[MeterCore1UsageValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[Core1Usage] : [Core1Usage:1]%

[MeterTopGPULabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Top GPU Usage

[MeterTopGPUValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[TopGPU] : [TopGPU:1]%

[MeterTotalVRAMLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Total VRAM Usage

[MeterTotalVRAMValues]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=TotalVRAMScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=[TotalVRAM] : %1B

[MeterRainmeterIOLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Rainmeter IO

[MeterRainmeterIOValues]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=RainmeterIOScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=[RainmeterIO] : %1B

[MeterTopIOReadLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Top IO Read

[MeterTopIOReadValues]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=TopIOReadScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=[TopIORead] : %1B

[MeterBrowserIOWriteLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Browser IO Write

[MeterBrowserIOWriteValues]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=BrowserIOWriteScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=[BrowserIOWrite] : %1B

[MeterBrowserRAMLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Browser RAM Usage

[MeterBrowserRAMValues]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=BrowserRAMScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=[BrowserRAM] : %1B

[MeterNetworkInLabel]
Meter=String
MeterStyle=AllStyle
Y=15R
Text=Net IN

[MeterNetworkInValues]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=NetworkInScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=%1B

[MeterNetworkOutLabel]
Meter=String
MeterStyle=AllStyle
Y=3R
Text=Net OUT

[MeterNetworkOutValues]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=NetworkOutScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=%1B

[MeterNetworkName]
Meter=String
MeterStyle=AllStyle
Y=3R
ClipString=1

The language of Rainmeter was set to English, and the two skin names were "Text" and "Text2". Except for one more line PIDToName=0 in "Text2", the rest of the codes for the two skins are exactly the same.
1.png
When I load "Text" first and then "Text2", both skins show the effect of PIDToName=1; otherwise, both skins show the effect of PIDToName=0.
2.gif
This is my feedback.
You do not have the required permissions to view the files attached to this post.
User avatar
Lssg97
Posts: 13
Joined: October 21st, 2018, 2:55 am

Re: A Bug about the UsageMonitor plugin

Post by Lssg97 »

I also tried it: I made a copy of the UsageMonitor.dll file in the Plugins folder. Applying the copy to Text2 still didn't solve the problem.
User avatar
tjhrulz
Developer
Posts: 226
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: A Bug about the UsageMonitor plugin

Post by tjhrulz »

Well that is an interesting case I missed, surprised that did not cause more catastrophic failure. I will get this updated asap.