Switch to the dark side!


Latest Discussion
3 months ago
7 months ago
7 months ago
7 months ago
7 months ago

Post a new topic

How to return the total number of cores?

Xevailo says:

Hello everyone :)

I am trying to write a multicore-CPU Plugin that shows a measure for each core available. The problem is that I can't find a way to display the total nuber of cores. If I use


with an Octacore-CPU, Measure 9 is always the average CPU usage. My plan was to use a if-then statement like this for every core:

IfBelowValue="total_cores" < N
IfBelowAction=!SetVariableGroup Hidden 1 CoreN

Of course, I'd replace N with the number of each core, and assign


to every item used in the script. The question is if there is a way to get a value for my imaginary "total_cores" variable.

Thanks in advance,


08:51 am, Tuesday, February 25, 2014 (7 months ago)
killall-q says:

Lua can read environment variables.

CoreCount = tonumber(os.getenv("NUMBER_OF_PROCESSORS"))

12:17 pm (2 months ago)

Reply to this topic

You must register and become a member to post a reply.