How can I get CPU usage percent with docker.containers.stats?

前端 未结 0 777
鱼传尺愫
鱼传尺愫 2020-12-29 15:09

Code:

import docker
cli = docker.from_env()
print(cli.containers.get(\'container1\').stats(stream=False)[\'precpu_stats\'])

Output:

         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题