For widgets that monitor CPU Core/s, I thought it might be helpful if the number of Cores on the CPU was visible as a Rainmeter System variable, something like #CPUCORECOUNT#.
Given that Rainmeter CPU Core 0 yields an average Core performance value, I suspect the core count could be being used internally, so if it could be brought to the surface, it might be useful for dynamically adjusting widgets.
It is currently March 28th, 2024, 2:24 pm
[Feature Req] CPU Core Count variable
- DavidRGreen
- Posts: 35
- Joined: May 5th, 2020, 10:19 am
- jsmorley
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: [Feature Req] CPU Core Count variable
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeterCores]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Number of processors is : %NUMBER_OF_PROCESSORS%
- DavidRGreen
- Posts: 35
- Joined: May 5th, 2020, 10:19 am
Re: [Feature Req] CPU Core Count variable
So it is there.
Thanks for pointing it out.
Now I can have a "Doh!" moment for not discovering it in the manual.
Maybe this, and other CPU related environment variables could be mentioned on the CPU Measure page of the manual
Thanks!
Thanks for pointing it out.
Now I can have a "Doh!" moment for not discovering it in the manual.
Maybe this, and other CPU related environment variables could be mentioned on the CPU Measure page of the manual
Thanks!
- jsmorley
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: [Feature Req] CPU Core Count variable
It's nothing to do with Rainmeter, it is a Windows %ENVIRONMENT% variable. You can see what exists for your system by opening a cmd.exe console and typing "set".DavidRGreen wrote: ↑May 31st, 2020, 2:08 pm So it is there.
Thanks for pointing it out.
Now I can have a "Doh!" moment for not discovering it in the manual.
Maybe this, and other CPU related environment variables could be mentioned on the CPU Measure page of the manual
Thanks!
https://docs.rainmeter.net/manual/variables/#EnvironmentVariables
- jsmorley
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: [Feature Req] CPU Core Count variable
If you want to distinguish between "physical cores" and "logical processors", I might suggest something like:
I like the /format:csv comma delimited format with wmic.exe, as it makes it quite a bit easier to parse. Just count commas...
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!CommandMeasure MeasureGetCores "Run"]
[MeasureGetCores]
Measure=Plugin
Plugin=RunCommand
OutputType=ANSI
Parameter=WMIC CPU Get DeviceID,NumberOfCores,NumberOfLogicalProcessors /format:csv
[MeasureGetPhysical]
Measure=String
String=[MeasureGetCores]
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?siU)^.*,.*,.*,.*,.*,(.*),(.*)$":"\1","#CRLF#":""
[MeasureGetLogical]
Measure=String
String=[MeasureGetCores]
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?siU)^.*,.*,.*,.*,.*,(.*),(.*)$":"\2","#CRLF#":""
[MeterCores]
Meter=String
MeasureName=MeasureGetPhysical
MeasureName2=MeasureGetLogical
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Physical Cores %1#CRLF#Logical Cores %2
I like the /format:csv comma delimited format with wmic.exe, as it makes it quite a bit easier to parse. Just count commas...
- jsmorley
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: [Feature Req] CPU Core Count variable
However, the logic of the CPU measure is based on "logical processors", so just using the Environment variable might be enough.
- DavidRGreen
- Posts: 35
- Joined: May 5th, 2020, 10:19 am
Re: [Feature Req] CPU Core Count variable
Very interesting and enlightening.
I'll be looking into those.
Thanks.
I'll be looking into those.
Thanks.
- jsmorley
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: [Feature Req] CPU Core Count variable
Just FYI, another good option for wmic.exe is to use /format:list which will output like:
Which is also pretty easy to parse.
Code: Select all
DeviceID=CPU0
NumberOfCores=8
NumberOfLogicalProcessors=16
- DavidRGreen
- Posts: 35
- Joined: May 5th, 2020, 10:19 am
Re: [Feature Req] CPU Core Count variable
With that /format:list version of output, it could be interpreted as part of the Variables section; pipe it to a file and include it. It's just missing the [Variables] header, unless that header is optional when included the [Variables] section…