Breaking Changes
SystemLimits::$cpuCores: Changed frominttofloatto support fractional CPU quotas (e.g. 200m = 0.2 cores, 1500m = 1.5 cores).SystemLimits::$currentCpuCores: Changed frominttofloat.SystemLimits::availableCpuCores(): Now returnsfloatinstead ofint.SystemLimits::canScaleCpu(): Parameter changed frominttofloat.ContainerLimits::cpuUtilizationPercentage(): No longer capped at 100%. Can exceed 100% during over-quota burst scenarios.ContainerLimits::memoryUtilizationPercentage(): No longer capped at 100%.
Bug Fixes
- Fix CPU limit using headroom instead of quota:
CompositeSystemLimitsSourcewas usingavailableCpuCores()(quota − usage) to populate thecpuCoreslimit field. Now usescpuQuotadirectly. Same fix for memory. - Fix delta-based CPU usage sampling permanently broken:
CompositeContainerMetricsSourcecreated a newLinuxCgroupMetricsSourceon everyread(), resetting the parser's delta cache.cpuUsageCoreswas alwaysnull. The source is now persisted. - Fix fractional CPU precision loss: Removed
(int) ceil()casts that rounded cgroup quotas to whole cores.
Migration Guide
// Before (v2.x)
$cores = $limits->cpuCores; // int: 1, 2, 4, 8
// After (v3.0)
$cores = $limits->cpuCores; // float: 0.2, 1.5, 4.0, 8.0Closes #6
Full Changelog: v2.3.1...v3.0.0