It is currently April 27th, 2024, 7:59 am

NomFerp Plugin

Share and get help with Plugins and Addons
User avatar
cwfrizzell
Posts: 77
Joined: August 10th, 2009, 9:03 pm

Re: New PerfMon Plugin

Post by cwfrizzell »

jsmorley wrote:Here is a version of my skin I quickly converted to do memory (private bytes) instead of CPU. Does it also freeze Rainmeter for you?
PerfCounerSortMem_1.0.rmskin
1.jpg

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
TextFont=Fira Sans
TextSize=11
TextColor=235,245,255,255
DeadColor=170,180,190,255
OddColor=30,40,50
EvenColor=50,60,70

[MeasureListMemory]
Measure=Plugin
Plugin=NomFerp.dll
Order=Working Set - Private
Filter=_Total
OnUpdateAction=[!UpdateMeasureGroup All]

[MeasureProcess1Name]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Name
Instance=1
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(.*)#.*$":"\1"

[MeasureProcess1Mem]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Working Set - Private
Instance=1
UpdateDivider=-1
IfCondition=#CURRENTSECTION# = 0
IfTrueAction=[!SetOptionGroup 1 FontColor "#DeadColor#"]
IfFalseAction=[!SetOptionGroup 1 FontColor "#TextColor#"]
IfConditionMode=1

[MeasureProcess2Name]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Name
Instance=2
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(.*)#.*$":"\1"

[MeasureProcess2Mem]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Working Set - Private
Instance=2
UpdateDivider=-1
IfCondition=#CURRENTSECTION# = 0
IfTrueAction=[!SetOptionGroup 2 FontColor "#DeadColor#"]
IfFalseAction=[!SetOptionGroup 2 FontColor "#TextColor#"]
IfConditionMode=1

[MeasureProcess3Name]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Name
Instance=3
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(.*)#.*$":"\1"

[MeasureProcess3Mem]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Working Set - Private
Instance=3
UpdateDivider=-1
IfCondition=#CURRENTSECTION# = 0
IfTrueAction=[!SetOptionGroup 3 FontColor "#DeadColor#"]
IfFalseAction=[!SetOptionGroup 3 FontColor "#TextColor#"]
IfConditionMode=1

[MeasureProcess4Name]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Name
Instance=4
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(.*)#.*$":"\1"

[MeasureProcess4Mem]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Working Set - Private
Instance=4
UpdateDivider=-1
IfCondition=#CURRENTSECTION# = 0
IfTrueAction=[!SetOptionGroup 4 FontColor "#DeadColor#"]
IfFalseAction=[!SetOptionGroup 4 FontColor "#TextColor#"]
IfConditionMode=1

[MeasureProcess5Name]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Name
Instance=5
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(.*)#.*$":"\1"

[MeasureProcess5Mem]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListMemory
Counter=Working Set - Private
Instance=5
UpdateDivider=-1
IfCondition=#CURRENTSECTION# = 0
IfTrueAction=[!SetOptionGroup 5 FontColor "#DeadColor#"]
IfFalseAction=[!SetOptionGroup 5 FontColor "#TextColor#"]
IfConditionMode=1

[MeasureMemory]
Measure=PhysicalMemory

[StyleTextAll]
FontFace=#TextFont#
FontSize=#TextSize#
FontColor=#TextColor#
AntiAlias=1

[StyleTextLeft]
X=5
Y=4R
W=200
H=16
Padding=5,3,5,5

[StyleTextRight]
X=210
Y=3r
StringAlign=Right
NumOfDecimals=1
AutoScale=1
Text="%1B"

[MeterBackground]
Meter=Image
W=220
H=160
SolidColor=10,20,30,255

[MeterMemoryBar]
Meter=Bar
X=5
Y=5
W=210
H=24
MeasureName=MeasureMemory
BarColor=205,215,225,255
BarOrientation=Horizontal
SolidColor=50,60,70,255

[MeterMemoryText]
Meter=String
MeterStyle=StyleTextAll | StyleTextRight
MeasureName=MeasureMemory
Text=%1 Used

[MeterProcess1Name]
Meter=String
MeterStyle=StyleTextAll | StyleTextLeft
Group=1
MeasureName=MeasureProcess1Name
Y=10R
SolidColor=#OddColor#

[MeterProcess1Mem]
Meter=String
MeterStyle=StyleTextAll | StyleTextRight
Group=1
MeasureName=MeasureProcess1Mem

[MeterProcess2Name]
Meter=String
MeterStyle=StyleTextAll | StyleTextLeft
Group=2
MeasureName=MeasureProcess2Name
SolidColor=#EvenColor#

[MeterProcess2Mem]
Meter=String
MeterStyle=StyleTextAll | StyleTextRight
Group=2
MeasureName=MeasureProcess2Mem

[MeterProcess3Name]
Meter=String
MeterStyle=StyleTextAll | StyleTextLeft
Group=3
MeasureName=MeasureProcess3Name
SolidColor=#OddColor#

[MeterProcess3Mem]
Meter=String
MeterStyle=StyleTextAll | StyleTextRight
Group=3
MeasureName=MeasureProcess3Mem

[MeterProcess4Name]
Meter=String
MeterStyle=StyleTextAll | StyleTextLeft
Group=4
MeasureName=MeasureProcess4Name
SolidColor=#EvenColor#

[MeterProcess4Mem]
Meter=String
MeterStyle=StyleTextAll | StyleTextRight
Group=4
MeasureName=MeasureProcess4Mem

[MeterProcess5Name]
Meter=String
MeterStyle=StyleTextAll | StyleTextLeft
Group=5
MeasureName=MeasureProcess5Name
SolidColor=#OddColor#

[MeterProcess5Mem]
Meter=String
MeterStyle=StyleTextAll | StyleTextRight
Group=5
MeasureName=MeasureProcess5Mem
Yours, once again, works fine. Not sure what I'm missing...
Cheers!

Chuck
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New PerfMon Plugin

Post by jsmorley »

cwfrizzell wrote: Yours, once again, works fine. Not sure what I'm missing...
You might want to ensure that your skin .ini file is encoded as either ANSI or UTF-16 Little Endian Unicode. I have a bad feeling it might be encoded as some UTF-8 variant.
User avatar
cwfrizzell
Posts: 77
Joined: August 10th, 2009, 9:03 pm

Re: New PerfMon Plugin

Post by cwfrizzell »

jsmorley wrote: You might want to ensure that your skin .ini file is encoded as either ANSI or UTF-16 Little Endian Unicode. I have a bad feeling it might be encoded as some UTF-8 variant.
You were right... UTF-8 without BOM

Thanks!
Cheers!

Chuck
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New PerfMon Plugin

Post by jsmorley »

cwfrizzell wrote: You were right... UTF-8 without BOM

Thanks!
Glad to help. I think ailia needs to look at that, as while Rainmeter doesn't like UTF-8, which is fine, a plugin shouldn't react by "hanging up", which due to it not being threaded, but "blocking", hangs all of Rainmeter. Complicated and difficult for a new user to recover from, since it really means editing Rainmeter.ini to disable the skin before killing and restarting Rainmeter.
User avatar
cwfrizzell
Posts: 77
Joined: August 10th, 2009, 9:03 pm

Re: New PerfMon Plugin

Post by cwfrizzell »

jsmorley wrote:Glad to help. I think ailia needs to look at that, as while Rainmeter doesn't like UTF-8, which is fine, a plugin shouldn't react by "hanging up", which due to not being threaded, but "blocking", hangs all of Rainmeter. Complicated and difficult for a new user to recover from, since it really means editing Rainmeter.ini to disable the skin before killing and restarting Rainmeter.
And that's the process I repeated over and over: edit Rainmeter.ini, save, restart.

Wash, rinse, repeat.
Cheers!

Chuck
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New PerfMon Plugin

Post by Yincognito »

Just wanted to know : is there currently a way to get all the instances from a PerfMon counter using this plugin? For example, setting the Instance option to 0 or something like that.

I'm envisioning the scenario that one wants to get all the running processes displayed on a skin (sorted or not, it doesn't matter). As far as I know, we could refer each process by Instance=1, Instance=2, Instance=3 and so on, but the number of instances is a dynamic number, it changes during a Windows session, so it can't be done properly this way.

Of course, there is a way to get the number of processes in a separate measure and then making some sort of counter measure, which will stop when it reaches that number, displaying the corresponding meters using relative positioning in the meantime - but this is a somewhat laborious way to do it. Is there a simpler way that I don't know about?

This is by no means a feature request - I'm personally very happy with the current NomFerp features, integrating it nicely into an animated skin (finally I can get the IO stats, thank you, ailia) :
It's just a question regarding an alternative easier way to do the kind of "measuring" mentioned above.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
ailia
Posts: 34
Joined: August 6th, 2012, 9:56 pm
Location: Lurking

Re: New PerfMon Plugin

Post by ailia »

So you want everything dumped into a string or something? Or are you wanting the total count? Can't really tell based on what you are saying.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New PerfMon Plugin

Post by Yincognito »

So you want everything dumped into a string or something? Or are you wanting the total count? Can't really tell based on what you are saying.
If everything would be dumped into a string we would have to split the string in Rainmeter's code, instead of getting it in separate parts, like it is now (and it's good that way), but, yes, this is pretty much what I wanted to say.

To be even more clear : I want to get the CPU (or mem/IO/etc.) usage of every process that's running at a specific moment in time (not just 3 or 5 or a fixed number of processes). Right now this can't be easily achieved.

For example, as it is now, I can get the first 3, 5, or any fixed number of processes displayed, but if I have 95 running processes, I would have to create 95 x 2 measures (95 measures for the names, 95 for the % values). But what if I have 100 running processes? Then, with my 95 x 2 measures, I would miss the info on 5 processes. If I create 100 x 2 measures and there are 120 running processes, I again miss some info. See what I mean?

Of course, as I said before, I could write a big number of measures, i.e. 500 x 2 and have some code test if the info returned is 0, then hide the "invalid" entries (that is the "out of bounds" ones) and successfully display the data on each running process, but this is laborious (even using copy/paste), so I was interested if there was an easier way to do it.

But then again, if I'm on a super-computer or something and I have ... 501 processes running, the missing info problem would reappear.

Now this is all theoretical, I don't intend to do the above in my skins and I repeat, I don't want to push you to do it - I'm happy with what we already have - but this is a possible scenario for more picky and demanding users out there...

P.S. If you do want to do it, putting all the instances info on one string could be triggered when setting Instance to 0 (or "" - empty string), as it's a "free" number, and it doesn't affect the plugin behaviour in the "classic" cases (when we want a specific number of processes shown).

I hope I was more comprehensible this time ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New PerfMon Plugin

Post by Yincognito »

If I still was "vague", what I described above would be the equivalent of "*" or "<All instances>" in PerfMon.msc.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
fred_gaou
Posts: 60
Joined: July 30th, 2014, 1:00 am

Re: New PerfMon Plugin

Post by fred_gaou »

@Yincognito
Well I personally don't see the point to display all my processes in a skin (less than 60 on my system), most of them doesn't consume anything regarding CPU. But I would be curious how you'll use the feature request you describe in a skin. If ailia post an update with this feature and a new name for his plugin :D , please post an example skin.
  • Rainmeter 4.3.1.3321 64-bit (Sep 22 2019) - French (1036)
  • Windows 10 Pro 1909 64-bit (build 18363) - French (1036)
  • Path: D:\Programmes\Customisation\Rainmeter\
  • SkinPath: D:\Programmes\Customisation\Rainmeter\Skins\
  • SettingsPath: D:\Programmes\Customisation\Rainmeter\
  • IniFile: D:\Programmes\Customisation\Rainmeter\Rainmeter.ini