Skip to content

Commit

Permalink
feat: Do not check the load limit by default (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Aug 6, 2024
1 parent 052fbcc commit 307cd98
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/CpuCoreCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,23 @@ public function __construct(?array $finders = null)
* previous example, it will return 5 cores. How busy is
* the system is determined by the system load average
* (see $systemLoadAverage).
* @param float|null $systemLoadAverage The system load average. If not provided, it will be
* retrieved using `sys_getloadavg()` to check the load
* of the system in the past minute. Should be a positive
* float.
* @param float|null $systemLoadAverage The system load average. If passed, it will use
* this information to limit the available cores based
* on the _available_ resources. For instance, if there
* is 10 cores but 3 are busy, then only 7 cores will
* be considered for further calculation. If set to
* `null`, it will use `sys_getloadavg()` to check the
* load of the system in the past minute. You can
* otherwise pass an arbitrary value. Should be a
* positive float.
*
* @see https://php.net/manual/en/function.sys-getloadavg.php
*/
public function getAvailableForParallelisation(
int $reservedCpus = 0,
?int $countLimit = null,
?float $loadLimit = null,
?float $systemLoadAverage = null
?float $systemLoadAverage = 0.
): ParallelisationResult {
self::checkCountLimit($countLimit);
self::checkLoadLimit($loadLimit);
Expand Down

0 comments on commit 307cd98

Please sign in to comment.