Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1042

Bugs & Feature Suggestions • [Suggestion] More SysInfo information for the CPU (e.g. Processes, Theads, CPU Name etc.)

$
0
0
Sorry for the long overwhelming post, I tried to provide EVERYTHING I did that made me reach to making this post. I hope this isn't too much to ask, I wanted to remake the Task Manager CPU performance window with Rainmeter for funnies but I ran into a few things which I think would be nice to have in Rainmeter by default, at least on SysInfo.

The thing is, for everything I'm requesting, all of this can already be done with Powershell, thus this is not urgent, or impossible, but because of how much stuff you have possible right now without complicating yourself, I'm running into a few problems (which will be detailed below).

Sooo... for what I made - stuff that dosen't exist in Rainmeter but I wish they did since they were very easy to get - I used the following Powershell commands
  • Processor Name (Get-CimInstance Win32_Processor).Name
  • Utilization (Get-CimInstance Win32_Processor).LoadPercentage
  • Processes (Get-Process | Measure-Object).Count
  • Threads (Get-Process | % { $_.Threads.Count } | Measure-Object -Sum).Sum
  • Handles (Get-Process | % { $_.Handles } | Measure-Object -Sum).Sum
  • Base speed (Get-CimInstance Win32_Processor).CurrentClockSpeed
  • Current Voltage (Get-CimInstance Win32_Processor).CurrentVoltage
  • Cores (Get-CimInstance Win32_Processor).NumberOfEnabledCore
  • Logical Cores (Get-CimInstance Win32_Processor).NumberOfLogicalProcessors
  • L2 cache (Get-CimInstance Win32_Processor).L2CacheSize
  • L3 cache (Get-CimInstance Win32_Processor).L3CacheSize
  • Virtualization (Get-CimInstance Win32_Processor).VirtualizationFirmwareEnabled
I couldn't get L1 cache and Speed however since Windows dosen't offer that nowhere, which sucks but oh well

So why am I requesting this if I can already do everything with Powershell? 2 primary things
  1. On the very first update, the measures will always be nil.
    • I am aware that you can save some of the info that never changes to to a file, or only run the measures once, or hide everything until it returns anything, I have an OnRefreshAction that runs for those things that never change and stay the same (like the Processor Name, Cores, Cache Size). Preferably you would not want to write this info to a file if you're something like repair shop though.
  2. For stuff that needs constant updating, like the number of Processes, Handles and Threads, RunCommand and pwsh is KILLING my CPU and I keep getting the Error 101: Program still running: powershell for commands that, even when measured with Measure-Command with a result smaller than 1000 milliseconds, I still get the error, at a point it just desync without reason.
    • My suspicion is that for what I'm doing, pwsh first has to create the process, create an instance, read the instance, update the instance, parse the instance and then kill the instance and then the child... process, which is most likely why the graph keeps showing those spikes, and most likely why it ends up desync-ing.
    • So... what if we make a script that always runs and never disposes the object?

      Code:

      do {    Write-Host (Get-Process | % { $_.Handles } | Measure-Object -Sum).Sum    Sleep 1} while ($true)
      With this code my CPU is flat, so that most likely means the spikes happen because Rainmeter opens and kills a process every second (and probably because Roslyn is smart enough to not dispose of the object here). I am aware that I can use the Command Line Arguments here going forward, but this is reaching the complexity that I mentioned earlier that I didn't wanna reach
I would like for this to be more efficient, with the method I'm using, instances get disposed for no reason, however, from what I believe, in stuff like UsageMonitor, this dosen't happen and everything is Initialized correctly. I'd prefer if these things be adapted into SysInfo, since the things above seem like actual info you could use for measuing in Rainmeter. Also if someone else runs into the same idea or wants to get those information without too much hassel (the hassle to learn pwsh), the counters I got above would be nice to also exist in Raimeter.

I've tried to look for the API calls that can be used to get the same counters as above for this this:

Statistics: Posted by Jeff — Today, 3:53 pm — Replies 1 — Views 28



Viewing all articles
Browse latest Browse all 1042

Trending Articles