Skip to content

Update fidry/cpu-core-counter - #6620

Merged
ondrejmirtes merged 1 commit into
phpstan:2.3.xfrom
AJenbo:cpu-core-counter
Oct 23, 2026
Merged

ondrejmirtes merged 1 commit into
phpstan:2.3.xfrom
AJenbo:cpu-core-counter

Conversation

@AJenbo

@AJenbo AJenbo commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

This updates fidry/cpu-core-counter to 1.4 which added support for cgroups and lets us simplify CPU detection.

Comment thread src/Diagnose/SystemResourcesDiagnoseExtension.php Outdated
@AJenbo
AJenbo changed the base branch from 2.2.x to 2.3.x October 23, 2026 14:20
@AJenbo

AJenbo commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

@staabm I think including this in the current release cycle would be a good fit.

Comment on lines +37 to +40
// lists every limit the counter looks at, also one that is overridden by the limit found before it
$output->writeLineFormatted('<info>CPU core limit:</info>');
$output->writeRaw(Diagnoser::diagnose([$this->cpuCoreCounter->getCountLimitFinder()]));
$output->writeLineFormatted('');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested the output with this PR:

➜  phpstan-src git:(pr/6620) php bin/phpstan diagnose -vvv           
Note: Using configuration file /Users/m.staab/dvl/phpstan-src/phpstan.neon.dist.
PHP runtime version: 8.5.11
PHP composer.json required version: 8.2-8.6.99
PHP version for analysis: 8.5.11 (from config)

PHPStan version: 2.2.x-dev@1571cfc
PHPStan running from:
bin/phpstan

Extension installer: Not installed

Included configs from Composer packages:
phpstan/phpstan-deprecation-rules (rules.neon): 2.0.4
phpstan/phpstan-nette (extension.neon): 2.0.11
phpstan/phpstan-nette (rules.neon): 2.0.11
phpstan/phpstan-phpunit (extension.neon): 2.0.x-dev
phpstan/phpstan-phpunit (rules.neon): 2.0.x-dev
phpstan/phpstan-strict-rules (rules.neon): 2.0.10
shipmonk/dead-code-detector (rules.neon): 1.0.0

Discovered Composer project root:
/Users/m.staab/dvl/phpstan-src

Parallel worker creation:
Mechanism:                 fork (pcntl_fork)

Turbo extension: not loaded
Turbo platform: macos-arm64 (os: Darwin, machine: arm64, libc: gnu, php: 8.5, zts: no, debug: no)
Turbo worker binary: none found
Turbo trusted types: off (extension inactive)

System resources:
Detected CPU cores:        14
Load limit:                1
cgroup CPU quota:          none
KUBERNETES_CPU_LIMIT:      none
Usable CPU cores:          14

I think it looks good

@staabm staabm Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comparing this PR diagnose with master I see "Avaiable after limits" is no longer available, which I think is expected, correct @AJenbo ?

grafik

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm merging this. Feel free to send a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that’s expected. The relevant cap is applied internally to the lib so we can't really show the this info. Not a problem I think.

@ondrejmirtes
ondrejmirtes merged commit d88c17a into phpstan:2.3.x Oct 23, 2026
559 of 560 checks passed
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

@AJenbo
AJenbo deleted the cpu-core-counter branch October 23, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants