Skip to content

v3.0.0

Latest

Choose a tag to compare

@sylvesterdamgaard sylvesterdamgaard released this 29 Apr 20:22

Breaking Changes

  • SystemLimits::$cpuCores: Changed from int to float to support fractional CPU quotas (e.g. 200m = 0.2 cores, 1500m = 1.5 cores).
  • SystemLimits::$currentCpuCores: Changed from int to float.
  • SystemLimits::availableCpuCores(): Now returns float instead of int.
  • SystemLimits::canScaleCpu(): Parameter changed from int to float.
  • 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: CompositeSystemLimitsSource was using availableCpuCores() (quota − usage) to populate the cpuCores limit field. Now uses cpuQuota directly. Same fix for memory.
  • Fix delta-based CPU usage sampling permanently broken: CompositeContainerMetricsSource created a new LinuxCgroupMetricsSource on every read(), resetting the parser's delta cache. cpuUsageCores was always null. 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.0

Closes #6

Full Changelog: v2.3.1...v3.0.0