It is currently March 28th, 2024, 10:18 pm

% Pagefile Peak

Get help with creating, editing & fixing problems with skins
deltarho
Posts: 12
Joined: May 6th, 2018, 3:40 pm

% Pagefile Peak

Post by deltarho »

The following two measures are working fine

Code: Select all

[MeasurePageUsed]
Measure=Calc
Formula=MeasureSwapUsed - MeasurePhysicalUsed

[MeasurePagePercent]
Measure=Calc
Formula=MeasurePageUsed / MeasurePageTotal
However the next three are not.

Code: Select all

[MeasurePeak]
Measure=Calc
Formula=0

[MeasurePeakUsed]
IfCondition=MeasurePageUsed > MeasurePeak
IfTrueAction=[!SetOption MeasurePeak Value MeasurePageUsed]

[MeasurePeakPercent]
Measure=Calc
Formula=MeasurePeak / MeasurePageTotal
I am getting 0% for MeasurePeakPercent

I should add that I am a newbie to Rainmeter skinning so the learning curve is a tad steep at the moment. :???:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: % Pagefile Peak

Post by balala »

deltarho wrote:I am getting 0% for MeasurePeakPercent
Obviously. [MeasurePeak], according to its Formula=0 option, is always 0. This divided with [MeasurePageTotal] always gives 0 (at least while [MeasurePageTotal] is different then 0). Everything seem ok, at least from the posted measures.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: % Pagefile Peak

Post by ikarus1969 »

I would move the "IfCondition" and "IfTrueAction" to the "MeasurePeak" measure and change the "Value" from the "IfTrueAction" to "Formula" (because there's no "Value" but a "Formula" property of the Calc measure). Now you can delete the remaining "MeasurePeakUsed" measure.

then it should work

Code: Select all

[MeasurePeak]
Measure=Calc
Formula=0
IfCondition=MeasurePageUsed > MeasurePeak
IfTrueAction=[!SetOption MeasurePeak Formula MeasurePageUsed]

[MeasurePeakPercent]
Measure=Calc
Formula=MeasurePeak / MeasurePageTotal
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: % Pagefile Peak

Post by balala »

ikarus1969 wrote:change the "Value" from the "IfTrueAction" to "Formula" (because there's no "Value" but a "Formula" property of the Calc measure).]
:17good Very good, I didn't realize this mistake, when I initially looked to the original piece of code. :17good
deltarho
Posts: 12
Joined: May 6th, 2018, 3:40 pm

Re: % Pagefile Peak

Post by deltarho »

Thank you, but not quite there yet.

Suppose I have Usage=7 and Peak=7 and I open an application such that Usage=9. Peak will follow that with Peak=9.

However, if I then close the application and Usage=7 again then Peak follows it. I want Peak to remain at 9.

My original logic was flawed by having Formula=0 so it got reset on every pass. I changed that to Formula=MeasurePeak thinking that Formula would use the last MeasurePeak. However, Peak is still following Usage.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: % Pagefile Peak

Post by balala »

deltarho wrote:Suppose I have Usage=7 and Peak=7 and I open an application such that Usage=9. Peak will follow that with Peak=9.

However, if I then close the application and Usage=7 again then Peak follows it. I want Peak to remain at 9.
Not sure I can follow you. You would like to have the Peak at the largest value achieved so far by Usage?
deltarho
Posts: 12
Joined: May 6th, 2018, 3:40 pm

Re: % Pagefile Peak

Post by deltarho »

balala wrote:You would like to have the Peak at the largest value achieved so far by Usage?
Yes.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: % Pagefile Peak

Post by balala »

deltarho wrote:Yes.
Ok, the following Calc measure returns the largest value achieved so far by the [MeasurePageUsed] measure:

Code: Select all

[MeasurePeak]
Measure=Calc
Formula=( Max ( MeasurePeak, MeasurePageUsed ))
deltarho
Posts: 12
Joined: May 6th, 2018, 3:40 pm

Re: % Pagefile Peak

Post by deltarho »

Wow! Thanks balala. Had not seen Max with my readings so far. Need to spend sometime checking out the Formulas page.

Thanks again.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: % Pagefile Peak

Post by balala »

deltarho wrote:Need to spend sometime checking out the Formulas page.
Definitely.
I'm glad if you got it working.