Description
Hi,
I would like cadvisor to support containers using CFS.
To reproduce, start a container like this (allowed to use 10% of host CPU):
sudo docker run -it --cpu-period=10000 --cpu-quota=1000 ubuntu /bin/bash
Then create a while loop inside (or something else that would use close to 100% CPU):
while [ 1 ] ; do echo "Creating a load..." ; done
In this scenario I would expect cadvisor to show (in the web UI) how much CPU the container used based on it's allowed quota (in the cadvisor view for the container). Right now the percentage showed in cadvisor is calculated with the hosts maximum CPU rather than the containers set maximum CPU, so the above example show ~10% usage for the container (while it's in fact using most of it's capacity).
What are your views on this? It feels it should be possible to calculate the percentage based on the period and quota parameters to get an accurate display for the container?