As command "docker stats" gives details like:(I have put just header, not values)
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS I want the above details using python script. I have done following:
client = docker.DockerClient(base_url='unix:///var/run/docker.sock') for i in client.containers.list(): print(i.stats)
But not getting any useful information using i.stats and it's attribute. What should I do to get above details?