Documentation

CpuInfoFinder
in package
implements CpuCoreFinder

FinalYes

Find the number of CPU cores looking up at the cpuinfo file which is available on Linux systems and Windows systems with a Linux sub-system.

Tags
see
https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909
see
https://unix.stackexchange.com/questions/146051/number-of-processors-in-proc-cpuinfo

Table of Contents

Interfaces

CpuCoreFinder

Constants

CPU_INFO_PATH  = '/proc/cpuinfo'

Methods

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
getCpuInfo()  : string|null

Constants

Methods

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
string

find()

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|null

getCpuInfo()

private static getCpuInfo() : string|null
Return values
string|null

        
On this page

Search results