It is currently March 28th, 2024, 7:19 pm

NomFerp Plugin

Share and get help with Plugins and Addons
DollarD
Posts: 16
Joined: March 2nd, 2013, 5:56 pm

Re: New PerfMon Plugin

Post by DollarD »

Hmmmm,

Lack of interest? Not from my side, but perhaps if we show you....

Here's what I've been doing with your plugin:

Your bog-standard Process.ini:

Code: Select all

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

[Variables]
@Include="#CURRENTPATH#..\D10Variables.inc"
UpdDiv=2
........................................................................................................................................................
; NomFerp Measures
[CPU]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
Order=% Processor Time
Mode=Difference
Filter=_Total|Idle|Rainmeter
UpdateDivider=#UpdDiv#
[1CPUName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=name
Instance=1
[1CPU]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=% Processor Time
Mode=DifferenceTotalPercent
Instance=1
[2CPUName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=name
Instance=2
[2CPU]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=% Processor Time
Mode=DifferenceTotalPercent
Instance=2
[3CPUName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=name
Instance=3
[3CPU]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=% Processor Time
Mode=DifferenceTotalPercent
Instance=3
[4CPUName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=name
Instance=4
[4CPU]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=% Processor Time
Mode=DifferenceTotalPercent
Instance=4
[5CPUName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=name
Instance=5
[5CPU]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=CPU
Counter=% Processor Time
Mode=DifferenceTotalPercent
Instance=5
[Mem]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
Order=Working Set - Private
Filter=_Total|Rainmeter
UpdateDivider=#UpdDiv#
[1MemName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=name
Instance=1
[1Mem]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=Working Set - Private
Instance=1
[2MemName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=name
Instance=2
[2Mem]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=Working Set - Private
Instance=2
[3MemName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=name
Instance=3
[3Mem]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=Working Set - Private
Instance=3
[4MemName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=name
Instance=4
[4Mem]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=Working Set - Private
Instance=4
[5MemName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=name
Instance=5
[5Mem]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=Mem
Counter=Working Set - Private
Instance=5
[IOData]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
Order=IO Data Bytes/sec
Filter=_Total|Rainmeter
Mode=Difference
[1IODataName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=name
Instance=1
[1IOData]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=IO Data Bytes/sec
Mode=Difference
Instance=1
[2IODataName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=name
Instance=2
[2IOData]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=IO Data Bytes/sec
Mode=Difference
Instance=2
[3IODataName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=name
Instance=3
[3IOData]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=IO Data Bytes/sec
Mode=Difference
Instance=3
[4IODataName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=name
Instance=4
[4IOData]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=IO Data Bytes/sec
Mode=Difference
Instance=4
[5IODataName]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=name
Instance=5
[5IOData]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=IOData
Counter=IO Data Bytes/sec
Mode=Difference
Instance=5

; lua List Processor

[MeasureProcs]
Measure=Script
ScriptFile=Process.lua
UpdateDivider=#UpdDiv#

.................................................................................................................................................................

[Backdrop]
Meter=Image
;SolidColor=#ColorCplB#99
X=25
Y=0
W=1050
H=112
DynamicVariables=1


[MeterCProcsV]
Meter=STRING
Text=#CValues#
FontFace=#FontName#
FontColor=#ColorCplB#
FontSize=(#FontSize#-2)
;StringEffect=Border
FontEffectColor=#ColorCplA#
AntiAlias=1
StringAlign=RightBottom
StringStyle=Bold
X=845
Y=230
DynamicVariables=1
[MeterCProcsN]
Meter=STRING
Text=#CNames#
FontFace=#FontName#
FontColor=#ColorMain#
FontSize=(#FontSize#-2)
StringEffect=Shadow
FontEffectColor=#ColorShade#
AntiAlias=1
StringAlign=RightBottom
X=800
Y=230
DynamicVariables=1

[MeterMProcsV]
Meter=STRING
Text=#MValues#
FontFace=#FontName#
FontColor=#ColorCplB#
FontSize=(#FontSize#-2)
;StringEffect=Border
FontEffectColor=#ColorCplA#
AntiAlias=1
StringAlign=RightBottom
StringStyle=Bold
X=615
Y=230
DynamicVariables=1
[MeterMProcsN]
Meter=STRING
Text=#MNames#
FontFace=#FontName#
FontColor=#ColorMain#
FontSize=(#FontSize#-2)
StringEffect=Shadow
FontEffectColor=#ColorShade#
AntiAlias=1
StringAlign=LeftBottom
X=625
Y=230
DynamicVariables=1

[MeterDProcsV]
Meter=STRING
Text=#DValues#
FontFace=#FontName#
FontColor=#ColorCplB#
FontSize=(#FontSize#-2)
;StringEffect=Border
FontEffectColor=#ColorCplA#
AntiAlias=1
StringAlign=RightBottom
StringStyle=Bold
X=155
Y=230
DynamicVariables=1
[MeterDProcsN]
Meter=STRING
Text=#DNames#
FontFace=#FontName#
FontColor=#ColorMain#
FontSize=(#FontSize#-2)
StringEffect=Shadow
FontEffectColor=#ColorShade#
AntiAlias=1
StringAlign=RightBottom
X=125
Y=230
DynamicVariables=1
But wait. Is that a lua script enhancing it? Whatever could it be doing?

Lemme tell you. Process name beautification, and implementation of visible thresholds.

Code: Select all


function Initialize()
	
	sIncPath = SKIN:GetVariable("CURRENTPATH") .. "ProcessName.inc"
	tProcessName = ReadIni(sIncPath)
	sSectionName = "ProcessName"
	
end -- function Initialize

function Update()
	
	-- Fetch & Process Data
	
	local vC, vM, vD, tC, tM, tD = FixCounters()
	
	local nC, nM, nD = FixNames(tC, tM, tD)
	
	-- Import into Rainmeter
	
	SKIN:Bang("!SetVariable CNames \"" .. nC .. "\"")
	SKIN:Bang("!SetVariable MNames \"" .. nM .. "\"")
	SKIN:Bang("!SetVariable DNames \"" .. nD .. "\"")
	
	SKIN:Bang("!SetVariable CValues \"" .. vC .. "\"")
	SKIN:Bang("!SetVariable MValues \"" .. vM .. "\"")
	SKIN:Bang("!SetVariable DValues \"" .. vD .. "\"")

	return
	
end -- function Update

function FixNames(tC, tM, tD)
	
	-- Get data from measures
	
	local sCNameO = {}
	local sMNameO = {}
	local sDNameO = {}
	
	local sCNameV = {}
	local sMNameV = {}
	local sDNameV = {}
	local sAllNameV = {}
	
	local sCNameStacked = ""
	local sMNameStacked = ""
	local sDNameStacked = ""
	
	for i = 1,5 do 
		
		-- Get the measures
		sCNameO[i] = SKIN:GetMeasure('' .. i .. 'CPUName')
		sMNameO[i] = SKIN:GetMeasure('' .. i .. 'MemName')
		sDNameO[i] = SKIN:GetMeasure('' .. i .. 'IODataName')
		
		-- Then their strings without spaces
		sCNameV[i] = sCNameO[i]:GetStringValue()
		sMNameV[i] = sMNameO[i]:GetStringValue()
		sDNameV[i] = sDNameO[i]:GetStringValue()
		sCNameV[i] = string.gsub(sCNameV[i],"%s","")
		sMNameV[i] = string.gsub(sMNameV[i],"%s","")
		sDNameV[i] = string.gsub(sDNameV[i],"%s","")
		sCNameV[i] = string.gsub(sCNameV[i],"(.-)%#?%d?%d?","%1")
		sMNameV[i] = string.gsub(sMNameV[i],"(.-)%#?%d?%d?","%1")
		sDNameV[i] = string.gsub(sDNameV[i],"(.-)%#?%d?%d?","%1")
		
		-- Combined to check for new processes
		table.insert(sAllNameV, sCNameV[i])
		table.insert(sAllNameV, sMNameV[i])
		table.insert(sAllNameV, sDNameV[i])
		
		-- Then go human readable
		sCNameV[i] = sCNameV[i]:gsub("(.*)", tProcessName ) 
		sMNameV[i] = sMNameV[i]:gsub("(.*)", tProcessName ) 
		sDNameV[i] = sDNameV[i]:gsub("(.*)", tProcessName ) 
		
		-- And stack
		
		if tC >= i then sCNameStacked = sCNameStacked .. "\n" .. sCNameV[i] .. "\n"  end
		if tM >= i then sMNameStacked = sMNameStacked .. sMNameV[i] .. "\n\n"        end
		if tD >= i then sDNameStacked = sDNameStacked .. "\n".. sDNameV[i] .. "\n"   end
		
	end
	
	-- Checking for new processes and write to file
	
	for tIndex, sProcessName in pairs(sAllNameV) do
		if tProcessName[sProcessName] == nil then
			tProcessName[sProcessName] = sProcessName
			WriteIni(sIncPath,sSectionName,sProcessName,"" .. sProcessName .. " ")
			print("Added new process " .. sProcessName .. " to INC file")
		end
	end
	
	-- Then return stacked strings...
	
	return sCNameStacked, sMNameStacked, sDNameStacked
	
end

function FixCounters()
	
	-- Get data from measures
	
	local sCCtrO = {}
	local sMCtrO = {}
	local sDCtrO = {}
	
	local sCCtrV = {}
	local sMCtrV = {}
	local sDCtrV = {}
	
	local sCCtrT = 5
	local sMCtrT = 5
	local sDCtrT = 5
	
	local sCCtrStacked = ""
	local sMCtrStacked = ""
	local sDCtrStacked = ""
	
	
	for i = 1,5 do 
		
		-- Get the measures
		sCCtrO[i] = SKIN:GetMeasure('' .. i .. 'CPU')
		sMCtrO[i] = SKIN:GetMeasure('' .. i .. 'Mem')
		sDCtrO[i] = SKIN:GetMeasure('' .. i .. 'IOData')
		
		-- Then their values
		sCCtrV[i] = (sCCtrO[i]:GetValue() )
		sMCtrV[i] = (sMCtrO[i]:GetValue() )
		sDCtrV[i] = (sDCtrO[i]:GetValue() )
		
		-- And stack the rest
		if sCCtrV[i] < 1 then 
			sCCtrT = sCCtrT - 1
			else
			sCCtrStacked  = sCCtrStacked  .. "\n" .. string.format("%4.1f", sCCtrV[i] ) .. "%\n"
		end
		if sMCtrV[i] < (48 * 1024 * 1024) then 
			sMCtrT = sMCtrT - 1
			else
			sMCtrStacked = sMCtrStacked .. AutoScale(sMCtrV[i]) .. "\n\n"
		end
		if sDCtrV[i] < (1024 * 10) then
			sDCtrT = sDCtrT - 1
			else
			sDCtrStacked = sDCtrStacked .. AutoScale(sDCtrV[i]) .. "/s\n\n"
		end
		
	end
	
	return sCCtrStacked, sMCtrStacked, sDCtrStacked, sCCtrT, sMCtrT, sDCtrT
	
end

function ReadIni(filename)
	local f = io.open(filename,'r')
	if not f then return nil, print("ReadIni: Can't open file: "..filename) end
	local line_counter=0
	local tablename = {}
	local section
	for fline in f:lines() do
		line_counter=line_counter+1
		-- Ignore leading and trailing spaces
		local line = fline:match("^%s*(.-)%s*$")
		-- Ignore comments
		if not line:match("^[%;#]") and #line > 0 then
			-- Check for [Section]
			local sec = line:match("^%[(.*)%]$")
			if sec then
				section = sec
				--        if not tablename[section] then tablename[section]={} end
				else
				-- parse Key=Value
				local key, value = line:match("([^=]*)%=(.*)$")
				-- Remove white space from Key=Value
				key = key:match("^%s*(%S*)%s*$")
				value = value:match("^%s*(.-)%s*$")
				-- Check for error
				if not (key and value) then return nil, print('Error bad key or value in file:'.. filename..': '.. line_counter.."\n line:".. fline) end
				-- Set Section/Key/Value in table
				if section then
					if not tablename[key] then tablename[key]=value end
					--       if not tablename[key][value] then tablename[key][value]={} end
				end
			end
		end
	end
	f:close()
	return tablename
end -- function ReadIni

function WriteIni(file,section,key,value)
	local hFile=io.input(file,'r')
	if not io.type(hFile)=='file' then
		print('Cannot open file: '..file)
		else
		local Text=io.read('*all')
		hFile=io.output(file,'w')
		local NewText=string.gsub(Text,
			'%['..section..']([^%[]+)',
			function(a)
				if string.match(a,'\n%s-'..key..'%s-=') then
					a=string.gsub(a,'\n%s-'..key..'%s-=%s-([^;\n]+)','\n'..key..'='..value)
					else
					a=(string.match(a,'(.+)\n$') or '')..'\n'..key..'='..value..'\n'
				end
				return '['..section..']'..a
			end
		)
		io.write(NewText)
		io.close(hFile)
	end
end -- function WriteIni

function Round(num, idp)
	assert(tonumber(num), 'Round expects a number.')
	local mult = 10 ^ (idp or 0)
	if num >= 0 then
		return math.floor(num * mult + 0.5) / mult
		else
		return math.ceil(num * mult - 0.5) / mult
	end
end

function AutoScale(num)
	assert(tonumber(num), 'AutoScale expects a number.')
	local scales = {' B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'}
	local scale = ""
	local scaled = 0
	
	for i, v in ipairs(scales) do
		if (num < (1024 ^ i)) or (i == #scales) then
			scale = v
			scaled = num / 1024 ^ (i - 1)
			break
		end
	end
	
	-- .. string.rep(" ", math.max((3 - string.len(scaled .. "")), 0))
	
	return Round(scaled , math.max(2 - math.floor(math.log10(scaled + 0.01)),0)) .. " " .. scale
end
Essentially taking process names, and renaming them for my aesthetic sense. Reads from an .inc file that looks like this:

Code: Select all

[ProcessName]
3DVision=3DVision  
7z=7-Zip Console  
7za=7-Zip  
7za.dll=7Za Dll  
7zFM=7-Zip File Manager  
7zG=7-Zip Gui  
Acrobat=Acrobat  
acrodist=Acrodist  
adb=Android Debug Bridge  
AdFender=AdFender  
Ahk2Exe=Ahk2Exe  
Etcetera...

Essentially, ailia, thanks for not making me figure out a more convoluted way to get at my 'Identify Bottlenecks at a glace' rainmeter setup. Your plugin has been much appreciated.
Ap0st0l
Posts: 4
Joined: August 21st, 2015, 4:39 pm

Re: New PerfMon Plugin

Post by Ap0st0l »

It seems it doesn't work on Rainmeter 3.3.0 beta r2461 64-bit (Aug 15 2015)
Windows 10 Pro 64-bit (build 10240).

Image

Should I configure it somehow after installation or should it be working immediately?
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New PerfMon Plugin

Post by Yincognito »

Ap0st0l wrote:It seems it doesn't work on Rainmeter 3.3.0 beta r2461 64-bit (Aug 15 2015)
Windows 10 Pro 64-bit (build 10240).
Same versions as yours (except Windows 10, which is Enterprise for me) - working (in a virtual machine).
Ap0st0l wrote:Should I configure it somehow after installation or should it be working immediately?
It should work immediately, granted everything (files, folders, etc.) is in its place (aka where it should be). So it must be something you've done wrong, I guess. All my skins (including the NomFerp based one) are working correctly with these Rainmeter and Windows versions. I haven't tested for Windows 10 Pro though, only Enterprise version.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Ap0st0l
Posts: 4
Joined: August 21st, 2015, 4:39 pm

Re: New PerfMon Plugin

Post by Ap0st0l »

Yincognito wrote: It should work immediately, granted everything (files, folders, etc.) is in its place (aka where it should be). So it must be something you've done wrong, I guess. All my skins (including the NomFerp based one) are working correctly with these Rainmeter and Windows versions. I haven't tested for Windows 10 Pro though, only Enterprise version.
Strange... I just installed this example skin and this made by jsmorley, and it shows what I attached. All my other skins work flawlessly.
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New PerfMon Plugin

Post by Yincognito »

I just tried the example skin and the one made by jsmorley with no issues whatsoever.

Image
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Biohazardry
Posts: 2
Joined: August 27th, 2015, 4:14 pm

Re: New PerfMon Plugin

Post by Biohazardry »

Ap0st0l wrote:It seems it doesn't work on Rainmeter 3.3.0 beta r2461 64-bit (Aug 15 2015)
Windows 10 Pro 64-bit (build 10240).

Image

Should I configure it somehow after installation or should it be working immediately?
I am having the same problem as Ap0st0l has. Both meters made by jsmorley or the OP show me nothing. (Only the green bar from jsmorley's meter is working)

I am running:
3.3.0 beta r2461 64-bit (Aug 15 2015)
Windows 7 Professional 64-bit (build 7601) Service Pack 1

I checked and made sure I gotten the 'NomFerp.dll' in the 'Plugins' Folder. The Plugin is also noticed by Rainmeter in its Open Log -> Plugins Window.

But Rainmeters shows me those errors in its Log:

EDIT: 'Ungültiger Wert für den Paramter' translates to 'Value not valid for this Parameter'

I have tried it with the 3.2 Version too. Same result. I have closed Rainmeter and restarted it as administrator. Same result.

EDIT: I am running on a OS in German... could it be that this is the root of the evil? Because my PerfMonitor has the categories differently named?

Are you guys having any ideas what could cause that problem?
Last edited by Brian on September 28th, 2015, 2:28 pm, edited 1 time in total.
Reason: Please use [hsimg] for larger images.
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New PerfMon Plugin

Post by Yincognito »

Biohazardry wrote:I am running on a OS in German... could it be that this is the root of the evil? Because my PerfMonitor has the categories differently named?
I run the OS in English, so I have no way of testing your supposition, but it surely is possible. What I would do is try to isolate the problem (e.g. let only 1 or 2 of the "suspect" sections in the skin and then try to troubleshoot from there by changing to the exact PerfMon counter/name as shown by the OS).
Biohazardry wrote:Only the green bar from jsmorley's meter is working
This basically means that the plugin itself is somehow working. It's the "subdivisions" of name x / value x that are not, so there you must look for the problem.

EDIT : I just tried a little thing in my skins...it turns out that if a single Counter option is misspelled, all the name/values pairs from that relate to the respective parent group become 0 (aka invalid). So, if I have

Code: Select all

[MeasureListProcess]
Measure=Plugin
Plugin=NomFerp.dll
Order=% Processor Time
Mode=Difference
Filter=_Total|Idle
OnUpdateAction=[!UpdateMeasureGroup All]

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

[MeasureProcess1CPU]
Measure=Plugin
Plugin=NomFerp.dll
Group=All
ParentName=MeasureListProcess
Counter=% Processor Time
Mode=DifferenceTotalPercent
Instance=1
UpdateDivider=-1
IfCondition=#CURRENTSECTION# = 0
IfTrueAction=[!SetOptionGroup 1 FontColor "#NoColor#"]
IfFalseAction=[!SetOptionGroup 1 FontColor "#NameColor#"]
IfConditionMode=1
and I misspell Counter=Namee (instead of Counter=Name like it should be) in the MeasureProcess1Name section, then ALL the subsequent sections that relate to MeasureListProcess parent section become invalid (0 in the actual display in the skin). So you may want to explore the misspelling possibility too. Just try to have a single pair of proccess name/process value in your skin, make sure it's spelled correctly, test it, and if it works, just copy/paste to avoid typos.

Sorry I couldn't be more helpful, as I have no way of testing it to see if it's the German spelling possibility. But maybe ailia or jsmorley have other ideas, who knows?

ANOTHER EDIT: Having "Process is not a valid performance counter" error in the log probably means that, to be absolutely sure you cover all the "errors", you should also include the Category=whatever "Process" is called in Perfmon (or its German spelling?) in your skin. See:
Yincognito wrote:Several questions for ailia:

1. When Category option is not specified in the parent measures, it is assumed that Category=Process? Or does the plugin perform a search for the counter specified in the Order option from the parent measure to determine the respective category?
and the response from ailia:
ailia wrote:1. Yep, defaults to process.
from a previous reply on this topic.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Biohazardry
Posts: 2
Joined: August 27th, 2015, 4:14 pm

Re: New PerfMon Plugin

Post by Biohazardry »

WE are going somewhere ^^
Green bar thingy
I looked into it ... jsmorley did the bar with the regular Measure=CPU. So it works regardless.

I managed to get rid of the Error "Process is not a valid performance counter category", by adding the line Category=Prozess to the parent measure. (for the lazy reader: the 'c' became a 'z')

now I tried a couple of Variants for the Counter=% Processor Time.
It was tricky because first I thought the prefix '% ' meant something code-specific. Turns out it works with Order=Prozessorzeit (%).

So when I try to read the name, it works like a charm ('name' is the right word for both german and english).
BUT when I try to read the processortime value I get a value of 1.#QNAN.

EDIT: Now works (once I deleted your ifconditions of the sample)
very crude working example now if anyone runs into the same problem:

Code: Select all

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

[MeasureListProcess]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
Order=Prozessorzeit (%)
Mode=Difference
Filter=_Total|Idle
Category=Prozess
UpdateDivider=2

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

[MeasureProcess1CPU]
Measure=Plugin
Plugin=Plugins\NomFerp.dll
ParentName=MeasureListProcess
Counter=Prozessorzeit (%)
Mode=DifferenceTotalPercent
Instance=1

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

[MeterCPUText]
Meter=String
MeasureName=MeasureProcess1Name
Text=name %1

[MeterCPUPerc]
Meter=String
MeasureName=MeasureProcess1CPU
X=20R
Text=cpu %1
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New PerfMon Plugin

Post by Yincognito »

Biohazardry wrote:WE are going somewhere ^^
Great - I'm happy it worked. Your supposition regarding the language proved right, so basically it's you who did all the investigation and troubleshoot, I just gave my view on how to make it easier to test/correct.
Biohazardry wrote:It was tricky because first I thought the prefix '% ' meant something code-specific. Turns out it works with Order=Prozessorzeit (%).
Well, it shouldn't have been tricky at all. From my experience with it, the names are EXACTLY the same as in Perfmon.exe from Windows. So just copying the counter/category/whatever names from there to your skin should do the trick, so that it wouldn't be ... tricky :)
Biohazardry wrote:Now works (once I deleted your ifconditions of the sample)
Well, it's not my ifconditions, hahaha! The "sample" is taken right from the jsmorley skin via copy paste ;)

SUGGESTION (to ailia?): A short note regarding this should be written on the first page of this topic. Something like:
"If you use an OS in a different language than English, the Category/Counter/Order names should be the corresponding versions in that language, as seen by running Perfmon.exe/Perfmon.msc in Windows".

People expect the sample skins to work regardless, so this little note should help them make the necessary modifications without having to read the topic up until page 6. Just saying...:)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New PerfMon Plugin

Post by Yincognito »

Ailia, if you're still watching this, I (and not only me) have a problem with the functioning of your plugin. I've been trying for several days along with another skin designer here to debug an issue in my MyiniMeter skin suite here, issue related to the Processes skin that uses your NomFerp plugin.

Long story short, it's about localized (aka non-English) operating systems like French Windows 8.1 or Windows 7, where your plugin does not produce the desired results (e.g. no values at all). As I already discussed with Biohazardry on this topic, I did use the local French names for the queried counters. While this seemed to work on a pure French Windows XP (French counter names) and also on my English Windows 7 "updated" with a French language pack (where it worked using English counter names), this failed on the French version of Windows 7 and Windows 8.1 (x64). No language really worked there.

Both sephirotess (the other skin designer) and me have been getting this kind of messages in the Rainmeter's log:
Dictionary Key Error NomFerp.jpg
It took a while to test on different operating systems and notice when and where the issues popped up and sephirotess was also eager to make it work, as he was looking for a viable replacement for the old and buggy TopProcesses plugin (so he's a potential user for you). Unfortunately, due to the problem and the fact that he needs the plugin/skin/code to work on French systems, he couldn't really use your work.

Our tests concluded that the root of the problem are not the actual systems (almost all of them being cleanly installed on virtual machines), but some glitch regarding the functioning of your plugin. Due to the type of message that popped up in the Rainmeter log, I googled a little bit and I suspect the problem has to do with this. It's just a guess, but if your code is in C# and you're using dictionaries to sort the values, the Unicode issue presented there could be the cause of the issue in your plugin too. That's all I could do in trying to "narrow"/isolate the root of the problem.

Having said that, all we have are mostly suppositions, as your plugin code is not available to check it out (I know a little C# and coded in other languages as well, so at least for isolating the problem I think I can make a mostly correct assumption). That's why I finally decided to write you a message on this, only after making sure that the other possible causes have been reasonably eliminated. Nevertheless, I would kindly ask you to look at it, at least, as you are the one who could really tell if we are right and then point out to possible workarounds (if any) or hopefully, updating the "suspect" area in your plugin code (if your plugin is indeed causing this, that is).

The system where I finally been able to reproduce sephirotess' problem is available for download here. Don't worry, it has no illegal stuff included, lol.

Please take a look at it, ailia, and let us know what you think of it. I'll be glad to provide additional information about our "testing", if required.

Thank you.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth