It is currently September 21st, 2021, 5:16 pm

Active percentage time disk

Help with creating, editing & fixing problems with skins
rainmeteruser
Posts: 2
Joined: December 15th, 2014, 10:49 am

Active percentage time disk

Post by rainmeteruser »

Hi

I use this snippit to try to show my active disk usage in percent.
I use the performance monitor plug, however when I look at the values the string shows me,
I see values like 85000, instead of values between the range of 0, 100. Any idea what I'm doing wrong?

Code: Select all

[Mse_DriveActive]
Measure=Plugin
Plugin=Plugins\PerfMon.dll
PerfMonObject=LogicalDisk
PerfMonCounter="% Disk Time"
PerfMonInstance="C:"

[MeterUsedHDD1%]
MeasureName=Mse_DriveActive
Meter=STRING
X=121
Y=42
FontColor=#color#
FontFace=#Font#
FontSize=11
StringAlign=Center
StringStyle=BOLD
AntiAlias=1
Text="%1 active"
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Active percentage time disk

Post by jsmorley »

You need to add Percentual=1 to the String meter to use the value as a percentage.

In the PerfMon counters in Windows, the value measured is not directly a percentage, but is a measurement, I think in bytes, related to the disk queue length.

I have no idea how to use it as a percentage properly, as Perfmon.exe uses an internal "maximum" that is based some calculation of the disk queue, and without knowing what a reasonable MaxValue is for the measure in Rainmeter, it is difficult to get any kind of reliable percentage.

http://blogs.technet.com/b/askcore/archive/2012/03/16/windows-performance-monitor-disk-counters-explained.aspx

Some of these measurements are hard to get right. You have to understand that the PerfMon plugin and Perfmon.exe are not the same thing, they are just both based on the same raw data. The Perfmon.exe application returns percentages in the UI, but how it arrives at the percentage is based on the raw data (which both it and the plugin uses) but with Perfmon.exe "knowing" what the "maximum" value is for the measured value for some period of time, and we don't have any way to automatically get what it uses. So the Rainmeter skin has to be manually set with some MaxValue for the measure that makes sense, but knowing what that is in any way that will match what is in Perfmon.exe is not always easy.

Most measures in Rainmeter can "know" what the "maximum" value is in order to arrive at a percentage. FreeDiskSpace knows how large your hard drive is for instance. However any measure in Rainmeter that don't "know" what MaxValue is, things like the Network measures and Perfmon plugin for example, set the "maximum" to the highest value it has measured since the skin was loaded / refreshed. For any skin using a measure in this way as a "percentage", this basically means that the first measurement will always be 100%, and it will only get more accurate and useful over time as the resource being measured is exercised.

A similar issue came up in this thread:

http://rainmeter.net/forum/viewtopic.php?p=106231#p106231
rainmeteruser
Posts: 2
Joined: December 15th, 2014, 10:49 am

Re: Active percentage time disk

Post by rainmeteruser »

Thank you for your comprehensive response!

I couldn't make sense of the % disk time values, so I tried a slightly different approach.
I used your advice, and changed the parameter. This is what I came up with:

Code: Select all

PerfMonCounter="% Idle Time"
PerfMonInstance="C:"
MaxValue=10000000
InvertMeasure=1
These settings seem to give a correct result.

Thanks for the help!
User avatar
JonPeyton
Posts: 8
Joined: November 3rd, 2015, 1:39 am
Location: Tennessee

Re: Active percentage time disk

Post by JonPeyton »

When you see that Coyote , you're gonna get a "comprehensive response", thankfully :welcome: