It is currently September 14th, 2024, 10:07 pm

Disk Activity

Skins that monitor system information
RogerDodger
Posts: 19
Joined: May 24th, 2023, 3:11 pm

Re: Disk Activity

Post by RogerDodger »

So I found the error of my ways. In the MeterStorage4Activity I was mistakenly using the Disk1 activity instead of Disk4 activity. Everything seemed to work correctly.
However, when I tried changing the plugin from PerfMon to UsageMonitor nothing works the way it should. All the drives mimic the Disk0 (C:) activity. The new code follows but from what I can understand the UsageMonitor gets its data from the PerfMon app and yet the manual says to use different terminology to access the counters.
By the way, M and P are partitions on the same physical drive.

On a side note, you recommend not using special characters in variable names. Not even an underscore (_)? Is there a better way of indicating sub groups of a variable instead of making it a single word? For instance, instead of #Color0#, #Color1#, etc., have #Color_0#, #Color_1#?

Code: Select all

Disk0=C:
Disk1=M:
Disk2=D:
Disk3=G:
Disk4=P:

[MeasureDisk1Percent]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter=% Disk Time
Instance=#Disk1#

[MeasureDisk1Read]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter=Disk Reads/sec
Instance=#Disk1#

[MeasureDisk1Write]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter=Disk Writes/sec
Instance=#Disk1#
IfConditionMode=1
IfCondition=((MeasureDisk1Read = 0)&&(MeasureDisk1Write = 0))
IfTrueAction=[!SetVariable Disk1Color 0]
IfCondition2=((MeasureDisk1Read > 0)&&(MeasureDisk1Write = 0))
IfTrueAction2=[!SetVariable Disk1Color 1]
IfCondition3=((MeasureDisk1Read = 0)&&(MeasureDisk1Write > 0))
IfTrueAction3=[!SetVariable Disk1Color 2]
IfCondition4=((MeasureDisk1Read > 0)&&(MeasureDisk1Write > 0))
IfTrueAction4=[!SetVariable Disk1Color 3]

[MeasureDisk4Percent]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter=% Disk Time
Instance=#Disk4#

[MeasureDisk4Read]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter=Disk Reads/sec
Instance=#Disk4#

[MeasureDisk4Write]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter=Disk Writes/sec
Instance=#Disk4#
IfConditionMode=1
IfCondition=((MeasureDisk4Read = 0)&&(MeasureDisk4Write = 0))
IfTrueAction=[!SetVariable Disk4Color 0]
IfCondition2=((MeasureDisk4Read > 0)&&(MeasureDisk4Write = 0))
IfTrueAction2=[!SetVariable Disk4Color 1]
IfCondition3=((MeasureDisk4Read = 0)&&(MeasureDisk4Write > 0))
IfTrueAction3=[!SetVariable Disk4Color 2]
IfCondition4=((MeasureDisk4Read > 0)&&(MeasureDisk4Write > 0))
IfTrueAction4=[!SetVariable Disk4Color 3]

[MeterStorage1Activity]
Meter=Roundline
Container=MeterStorage1Container
MeasureName=MeasureDisk1Percent
MeterStyle=styleSystemActivityGraph
LineColor=[#ActivityColor:[#Disk1Color]]
Y=(#StoragePieGraph:Y# + 1)
DynamicVariables=1

[MeterStorage4Activity]
Meter=Roundline
Container=MeterStorage4Container
MeasureName=MeasureDisk4Percent
MeterStyle=styleSystemActivityGraph
LineColor=[#ActivityColor:[#Disk4Color]]
Y=(#StoragePieGraph:Y# + 1)
DynamicVariables=1
Last edited by Yincognito on August 10th, 2024, 1:01 pm, edited 1 time in total.
Reason: To post code, select it and click the </> button above the message box.
RogerDodger
Posts: 19
Joined: May 24th, 2023, 3:11 pm

Re: Disk Activity

Post by RogerDodger »

OK, looks like I may have figured it out. Apparently if I add the Whitelist option to each measure and just have that particular disk/partition name listed then it will show what I need it to.

I would still appreciate suggestions on the Variable names alternatives.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2736
Joined: March 23rd, 2015, 5:26 pm

Re: Disk Activity

Post by SilverAzide »

RogerDodger wrote: August 10th, 2024, 3:40 pm OK, looks like I may have figured it out. Apparently if I add the Whitelist option to each measure and just have that particular disk/partition name listed then it will show what I need it to.

I would still appreciate suggestions on the Variable names alternatives.
Underscores are definitely fine! What I meant is it is best practice to avoid things like math symbols, parentheses, brackets, spaces, decimals, commas, (semi-)colons, and other special characters that have significance to Rainmeter. I've even seen people use emojis and they work fine too, LOL.
Gadgets Wiki GitHub More Gadgets...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2736
Joined: March 23rd, 2015, 5:26 pm

Re: Disk Activity

Post by SilverAzide »

RogerDodger wrote: August 10th, 2024, 3:40 pm OK, looks like I may have figured it out. Apparently if I add the Whitelist option to each measure and just have that particular disk/partition name listed then it will show what I need it to.
Whitelist? No need to do that! You all you need to do is fix your measure. You used "Instance" when you should have used "Name":

Code: Select all

[MeasureDisk1Percent]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter=% Disk Time
Name=#Disk1#
The reference to Instance in the docs was to how Windows references them. Rainmeter uses "Name" or "Index". By using "Instance" (which is not an option), that was the same as not setting anything and letting it default (which is the counter's "Total" value).
Gadgets Wiki GitHub More Gadgets...
RogerDodger
Posts: 19
Joined: May 24th, 2023, 3:11 pm

Re: Disk Activity

Post by RogerDodger »

Thanks SilverAzide! Your information was immensely helpful. Everything is working perfectly now. I greatly appreciate it. :17good