gpt4 book ai didi

kubernetes - 将kubernetes kublet API的useNanoCore或usageCoreNanoSeconds转换为CPU利用率%Kubernetes kublet API

转载 作者:行者123 更新时间:2023-12-02 12:23:17 25 4
gpt4 key购买 nike

我正在查询Kubernetes kubelet API(curl -s http://localhost:10255/stats/summary)以获得CPU /内存统计信息,并且CPU信息显示如下。

        "cpu": {
"time": "2016-08-04T22:48:22Z",
"usageNanoCores": 6392499,
"usageCoreNanoSeconds": 3270519504746
},

如何将usageNanoCores或usageCoreNanoSeconds转换为CPU利用率百分比?

最佳答案

If a process were to run on one cpu continuously for a second, its usage will be 1e+9 nanoseconds. If it ran on n cores continuously its usage will n * 1e+9 nanoseconds.

Percentage will be usage_in_nanoseconds / (capacity_in_absolute_cores * 1e+9).



*来源: https://github.com/kubernetes/heapster/issues/650#issuecomment-147795824

关于kubernetes - 将kubernetes kublet API的useNanoCore或usageCoreNanoSeconds转换为CPU利用率%Kubernetes kublet API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38798601/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com