【问题标题】:What's the unit of latest_usage.cpu?latest_usage.cpu 的单位是什么?
【发布时间】:2018-03-22 08:15:57
【问题描述】:

我想了解我的 docker-containers 的 cpu 使用率。所以我消费

/api/v2.0/summary/<container-name>?type=docker

响应看起来像

{
  "/docker/...": {
    "timestamp": "2018-03-20T10:07:31.606821474Z",
    "latest_usage": {
       "cpu": 8,
       "memory": 1769402368
    }
  }
}

我的想法是使用latest_usage.cpu。但是这个领域的单位是什么?百分比?

这个字段是监控cpu使用率的正确选择吗?

【问题讨论】:

    标签: docker cadvisor


    【解决方案1】:

    百分比。

    来自 cAdvisor 源代码:

    cpuRate := (latest.Cpu - previous.Cpu) * secondsToMilliSeconds / uint64(elapsed)
    LatestUsage.cpu = cpuRate
    

    【讨论】:

    • 谢谢元坤。你帮了我很多。
    猜你喜欢
    • 2013-07-24
    • 2016-09-08
    • 1970-01-01
    • 2013-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多