It is currently March 28th, 2024, 3:50 pm

Top Process Meter - Gadgets Patch 6.0.0

A package of skins with a "theme" or by a single author
Yemble
Posts: 14
Joined: March 13th, 2018, 3:36 pm

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by Yemble »

Yemble wrote:I get the black box, but the only text on it is "Top Process:", blank line, 0.

Nothing else :(

I'll try the same on a Windows 10 PC when I get home.

Note that I am running the portable version of Rainmeter, if that makes any difference (I prefer all the files to be within a single folder structure). I'm wondering whether, or not, the DLLs require registering manually ? ... although, having said that, all of your other gadgets are functioning perfectly. Also, according to Task Manager, I have approx 138 processes running, which is pretty typical for this laptop.
Exactly the same result on my Windows 10 laptop, this time with a standard installation of Rainmeter.

There are only two commonalities between these two machines:

1) Both x64
2) Both in UK Windows region
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by SilverAzide »

OK, that pretty much settles it. Something is up with the AdvancedCPU measure in your case. I'm not sure if there is a bug in this measure or some glitch with your machine, like a corrupted performance counter database. I'm using 64-bit Win 10 too and not having any issues, so perhaps it is locale related (there are some known problems with performance counters because they can have names that are locale-specific). I'm guessing your performance counters database is OK, because if it wasn't, it is super-easy to notice because the Gadget's Drives Meter skin goes bonkers.

If you want to reset your perf counters database just to be extra sure, you can follow these steps here. If this doesn't work, perhaps a posting in the Bug forum is in order.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by jsmorley »

Yemble
Posts: 14
Joined: March 13th, 2018, 3:36 pm

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by Yemble »

On the Windows 7 laptop the disable Registry key was missing, so I added it in. I rebuilt both PerfMon DBs successfully, with no errors reported. Then I rebooted.

After the reboot, Top Process Meter is now reporting process stats :thumbup:

I'll do the same on the Windows 10 laptop tonight, but I'm sure the fix will work on that as well. I can't believe that this is due to any corruption though, because the machine builds and environments are completely different. It must be some Windows default (maybe peculiar to UK) that needs to be reset... that missing Disable Performance Counters Registry key looks favourite to me.

CPU hit for Rainmeter appears to be around 3% to 4%, however, this is with "Idle" being displayed.

Anyway, many thanks for your suggestions :thumbup: :thumbup: :thumbup:
Yemble
Posts: 14
Joined: March 13th, 2018, 3:36 pm

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by Yemble »

SilverAzide wrote:OK, that pretty much settles it. Something is up with the AdvancedCPU measure in your case. I'm not sure if there is a bug in this measure or some glitch with your machine, like a corrupted performance counter database. I'm using 64-bit Win 10 too and not having any issues, so perhaps it is locale related (there are some known problems with performance counters because they can have names that are locale-specific). I'm guessing your performance counters database is OK, because if it wasn't, it is super-easy to notice because the Gadget's Drives Meter skin goes bonkers.

If you want to reset your perf counters database just to be extra sure, you can follow these steps here. If this doesn't work, perhaps a posting in the Bug forum is in order.
OK, now that TPM is finally working, I can see why you stated that you were not 100% happy with it. I've got it configured for six processes, with Idle disabled. When it refreshes every second, it does not always display all six processes, often one or more of the list items (up to five) are blank. The Rainmeter CPU hit is now averaging at around 3.5%, up from <1%.

Is PerfMon the best method for getting this data? WMI might be an alternative and possibly the one that Microsoft use for TaskManager, which has a very low CPU hit (0.4%)?

There is definitely some scope for (significant) improvement here, most likely within the AdvancedCPU plugin, especially when you consider that TaskManager can handle a much bigger list, sorted by CPU, refreshed every second with a negligible CPU hit ;-)
Yemble
Posts: 14
Joined: March 13th, 2018, 3:36 pm

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by Yemble »

To illustrate this, I have knocked up a bit of VB Script that uses a WMI query to get the processor info...

Code: Select all

<job>
<?job Error = "true" debug = "false" ?>
<script language = vbscript>

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

while true
	Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process")
	For Each objProcess in colProcesses
		Wscript.Echo "Process: " & objProcess.Name
		sngProcessTime = (CSng(objProcess.KernelModeTime) + CSng(objProcess.UserModeTime)) / 10000000
		Wscript.Echo "Processor Time: " & sngProcessTime
		Wscript.Echo "Process ID: " & objProcess.ProcessID
		Wscript.Echo "Working Set Size: " & objProcess.WorkingSetSize
		Wscript.Echo "Page File Size: " & objProcess.PageFileUsage
		Wscript.Echo "Page Faults: " & objProcess.PageFaults
		Wscript.Echo
	Next
	WScript.Sleep(1000)
wend

</script>
</job>
This is pretty simplistic, but it does act as a reference for what could be done using WMI. Remember that this is interpretted code (not compiled) and it is not written in the worlds most efficient language. When run via Cscript.exe, this code averages at 1.5% CPU. Granted it is not doing any of the list sorting, but that is a trival task for a computer. This could all be done a lot more efficiently in C++.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by SilverAzide »

Yemble wrote:OK, now that TPM is finally working, I can see why you stated that you were not 100% happy with it. I've got it configured for six processes, with Idle disabled. When it refreshes every second, it does not always display all six processes, often one or more of the list items (up to five) are blank. The Rainmeter CPU hit is now averaging at around 3.5%, up from <1%.

Is PerfMon the best method for getting this data? WMI might be an alternative and possibly the one that Microsoft use for TaskManager, which has a very low CPU hit (0.4%)?
Yes, it appears that AdvancedCPU does not report processes with less than .01% CPU... or perhaps I missed some option that will allow it. This is why you will see blanks a lot of the time.

PerfMon is an alternative way to do this too, but it is problematic. Someone created a great plugin for getting perf mon info, NomFerp, but it appears to be abandonware and does have localization issues. I believe the Rainmeter devs are looking into building something similar, since there are known performance issues with AdvancedCPU and PerfMon measures that NomFerp does not appear to have. (For an example, try dragging the Top Process gadget around on the screen, you'll see it's very jerky...) I've offered to pay the dev's bar tabs to get something in the next release... :D
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by SilverAzide »

Yemble wrote:This is pretty simplistic, but it does act as a reference for what could be done using WMI. Remember that this is interpretted code (not compiled) and it is not written in the worlds most efficient language. When run via Cscript.exe, this code averages at 1.5% CPU. Granted it is not doing any of the list sorting, but that is a trival task for a computer. This could all be done a lot more efficiently in C++.
If you want to try a similar Top Process Meter skin that uses NomFerp, you can try raiguard's Modern Gadgets. There's even a patch to make my Gadgets look like his... :)
In any case, I don't have plans to use Nomferp at this time, but if a built-in Rainmeter alternative comes up, I'll switch my skin to use that instead.
Yemble
Posts: 14
Joined: March 13th, 2018, 3:36 pm

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by Yemble »

A better example containing all of the relevant fields...

Code: Select all

<job>
<?job Error = "true" debug = "false" ?>
<script language = vbscript>

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

while true
	Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfFormattedData_PerfProc_Process")
	For Each objItem in colItems
	    Wscript.Echo "Process:" & objItem.IDProcess & " - " & objItem.Name & " - " & objItem.PercentProcessorTime & "% - " & CSng(CSng(objItem.WorkingSetPrivate) / 1024.0) & "Kb"
			Wscript.Echo
	Next
	WScript.Sleep(1000)
wend

</script>
</job>
This rarely exceeds 1% CPU. How precise this usage data is on a single capture, I'm not too sure, but it serves as an illustration. Maybe I am just treading a path that the Devs have already been on, but it remains a fact that Windows TaskManager is very efficient at doing the same thing, so it stands to reason that there MUST be a more efficient method than that currently used within AdvancedCPU. Here's hoping the Devs find a way...

BTW, I MUCH prefer your skins to those of ModernGadgets :lol:
User avatar
dudebaker
Posts: 55
Joined: July 17th, 2016, 4:42 pm
Location: Austria

Re: Top Process Meter - Gadgets Patch 3.0.1 (Beta)

Post by dudebaker »

Then you could try my additions to the Gadgets from SilverAzide :).

The NomFerp.dll can be extracted via IlSpy and you'll get more or less the complete code.
Then combine it with this (https://wojciechkulik.pl/csharp/get-a-performancecounter-using-english-name) and you'll have a Perfmon-Plugin which works with all languages.

Hadn't time to do it but seems to be my next project :).
Last edited by dudebaker on March 15th, 2018, 5:14 pm, edited 1 time in total.
Post Reply