嗨,我发现了以下查询:
以秒为单位查找每个进程和节点的CPU使用率
sum(rate(namedprocess_namegroup_cpu_seconds_total{instance=~"tango.*"}[5m])) by (instance, groupname)
获取每个节点的cpu核心数
count(node_cpu_seconds_total{instance=~"tango.*",job="node"}) without (mode, cpu, job)
我该如何查询: 每个节点的CPU使用率(以百分比表示)考虑了节点的核心(值不超过100)
sum(rate(namedprocess_namegroup_cpu_seconds_total{instance=~"rcsecho.*"}[5m])) by (groupname) / count(node_cpu_seconds_total{instance="INSTANCE_FROM_FIRST_QUERY",job="rcs-node-info"}) without (mode, cpu, job) * 100
要获得如下结果: