It is currently March 28th, 2024, 9:23 am

NomFerp Plugin

Share and get help with Plugins and Addons
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New PerfMon Plugin

Post by jsmorley »

SilverAzide wrote:I assume you mean on the measure? OK, I did, but for me the code snippet above is returning a value hovering around 600%.
Well, not sure. tjhrulz will have to weigh in on this.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New PerfMon Plugin

Post by jsmorley »

Code: Select all

[MeasureDiskIdleTimeAll]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter="% Idle Time"
Name=_Total
See if that doesn't work.
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA
Contact:

Re: New PerfMon Plugin

Post by raiguard »

New issue: % Idle Time measures are somehow reporting values of >100%, e.g. 100.03543. Because of this, my read/write time calc measures (Formula=(100 - MeasureDiskAIdleTime)) will go into the negatives, causing the meter to show a negative percentage of disk read/write time.

I've worked around this by adding an absolute value argument to the calc measure, but that is only temporary. The old PerfMon plugin always went up to exactly 100.0.

Edit: code

Code: Select all

[MeasureDiskAIdleTime]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter=% Idle Time
Name=A:
Group=DiskA
Disabled=#hideDiskA#

[MeasureDiskARWTime]
Measure=Calc
Formula=abs(100 - MeasureDiskAIdleTime)
MaxValue=100
MinValue=0
Group=DiskA
Disabled=#hideDiskA#
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth
Contact:

Re: New PerfMon Plugin

Post by tjhrulz »

raiguard wrote:New issue: % Idle Time measures are somehow reporting values of >100%, e.g. 100.03543. Because of this, my read/write time calc measures (Formula=(100 - MeasureDiskAIdleTime)) will go into the negatives, causing the meter to show a negative percentage of disk read/write time.

I've worked around this by adding an absolute value argument to the calc measure, but that is only temporary. The old PerfMon plugin always went up to exactly 100.0.
While uncommon it is possible for that counter to end up with a value of greater than 100, even in the perfmon.exe. I don't think there is nothing I can do about that, blame microsoft there.

Not sure why though you did not have that happening before though, mind posting the old PerfMon version of the code?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New PerfMon Plugin

Post by jsmorley »

Code: Select all

[MeasureDiskARWTime]
Measure=Calc
Formula=100 - (MeasureDiskAIdleTime > 100 ? 100 : MeasureDiskAIdleTime)
MaxValue=100
MinValue=0
Seems like a reasonable solution until we can figure out how anything can be more than 100% of itself... ;-)
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA
Contact:

Re: New PerfMon Plugin

Post by raiguard »

tjhrulz wrote:While uncommon it is possible for that counter to end up with a value of greater than 100, even in the perfmon.exe. I don't think there is nothing I can do about that, blame microsoft there.

Not sure why though you did not have that happening before though, mind posting the old PerfMon version of the code?
Aha, I was actually wrong. The PerfMon measures did report >100% as well, it's just that it never showed up in the meters because the meters had Percentual=1 when I was using PerfMon, but got removed when I switched to UsageMonitor.

So this is actually a much older bug...

Code: Select all

[MeasureDiskAIdleTime]
Measure=Plugin
Plugin=PerfMon
PerfMonObject=LogicalDisk
PerfMonCounter="% Idle Time"
PerfMonInstance="A:"
Group=DiskA
Disabled=#hideDiskA#

[MeasureDiskARWTime]
Measure=Calc
Formula=(100 - ((MeasureDiskAIdleTime / (#gadgetUpdateRate# / 1000)) / 100000))
MaxValue=100
MinValue=0
Group=DiskA
Disabled=#hideDiskA#
(Excuse the overuse of quotation marks, I'm fixing up the code style as I rewrite the measures...)
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New PerfMon Plugin

Post by jsmorley »

Better yet...

Code: Select all

[MeasureDiskARWTime]
Measure=Calc
Formula=100 - Clamp(MeasureDiskAIdleTime,0,100)
MaxValue=100
MinValue=0
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: New PerfMon Plugin

Post by SilverAzide »

jsmorley wrote:

Code: Select all

[MeasureDiskIdleTimeAll]
Measure=Plugin
Plugin=UsageMonitor
Category=LogicalDisk
Counter="% Idle Time"
Name=_Total
See if that doesn't work.
Holy CRAP... That actually works! It's actually working even better than the old PerfMon; PerMon always returns a value that is scaled weirdly, but UsageMonitor is returning a proper value.

I'm looking forward to reading the documentation on this... Index=0 and Name=Total returns totals and Name=_Total returns an average -- sometimes....
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New PerfMon Plugin

Post by jsmorley »

SilverAzide wrote:Holy CRAP... That actually works! It's actually working even better than the old PerfMon; PerMon always returns a value that is scaled weirdly, but UsageMonitor is returning a proper value.

I'm looking forward to reading the documentation on this... Index=0 and Name=Total returns totals and Name=_Total returns an average -- sometimes....
There is no Name=Total, just Name=_Total.

Here is the best I could come up with for now, as I'm not sure there is any hard and fast rule for when Index=0 or Name=_Total is the best bet. Perfmon is a bit of a swamp.

https://docs.rainmeter.net/manual-beta/plugins/usagemonitor/#Name
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: New PerfMon Plugin

Post by SilverAzide »

jsmorley wrote:There is no Name=Total, just Name=_Total.

Here is the best I could come up with for now, as I'm not sure there is any hard and fast rule for when Index=0 or Name=_Total is the best bet. Perfmon is a bit of a swamp.

https://docs.rainmeter.net/manual-beta/plugins/usagemonitor/#Name
Oops, yes, I got things twisted around. Index=0 shows "Total" as the string value of the measure, while Name=_Total returns "_Total" -- which might be an average instead of a total, thank you Microsoft. :)
Post Reply