CmiCmdletLogicalFinder
extends ProcOpenBasedFinder
in package
FinalYes
Find the number of logical CPU cores for Windows leveraging the Get-CimInstance cmdlet, which is a newer version that is recommended over Get-WmiObject.
Table of Contents
Constants
- CPU_CORE_COUNT_REGEX = '/NumberOfLogicalProcessors[\s\n]-+[\s\n]+(?<count>\d+)/'
Properties
Methods
- __construct() : mixed
- diagnose() : string
- Provides an explanation which may offer some insight as to what the finder will be able to find.
- find() : positive-int|null
- Find the number of CPU cores. If it could not find it, returns null. The means used to find the cores are at the implementation discretion.
- toString() : string
- countCpuCores() : int|null
- getCommand() : string
Constants
CPU_CORE_COUNT_REGEX
private
mixed
CPU_CORE_COUNT_REGEX
= '/NumberOfLogicalProcessors[\s\n]-+[\s\n]+(?<count>\d+)/'
Properties
$executor
private
ProcessExecutor
$executor
Methods
__construct()
public
__construct([ProcessExecutor|null $executor = null ]) : mixed
Parameters
- $executor : ProcessExecutor|null = null
diagnose()
Provides an explanation which may offer some insight as to what the finder will be able to find.
public
diagnose() : string
This is practical to have an idea of what each finder will find collect information for the unit tests, since integration tests are quite complicated as dependent on complex infrastructures.
Return values
stringfind()
Find the number of CPU cores. If it could not find it, returns null. The means used to find the cores are at the implementation discretion.
public
find() : positive-int|null
Return values
positive-int|nulltoString()
public
toString() : string
Return values
stringcountCpuCores()
protected
countCpuCores(string $process) : int|null
Parameters
- $process : string
Return values
int|nullgetCommand()
protected
getCommand() : string