If the cgroup v2 cpu.max file contains a value other than max for its first segment, we're able to calculate the number of used CPUs in containers. If that's possible, the usage percentage is divided by the number of CPUs.
This change will result in a non-backward compatible change for those relying on > 100% old values.
Meaning that if there're 5 CPUs available and they're all at 100% usage, the usage won't be reported anymore as 500% but as 100%.
If the cgroup v2
cpu.max
file contains a value other thanmax
for its first segment, we're able to calculate the number of used CPUs in containers. If that's possible, the usage percentage is divided by the number of CPUs.This change will result in a non-backward compatible change for those relying on > 100% old values.
Meaning that if there're 5 CPUs available and they're all at 100% usage, the usage won't be reported anymore as 500% but as 100%.
Part of: #67