Add pod-level metric for CPU and memory stats
This PR adds the pod-level metrics for CPU and memory stats. cAdvisor can get all pod cgroup information so we can add this pod-level CPU and memory stats information from the corresponding pod cgroup
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/kubernetes/pkg/api/v1/resource"
|
||||
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
|
||||
v1qos "k8s.io/kubernetes/pkg/apis/core/v1/helper/qos"
|
||||
@@ -222,3 +223,8 @@ func getCgroupProcs(dir string) ([]int, error) {
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// GetPodCgroupNameSuffix returns the last element of the pod CgroupName identifier
|
||||
func GetPodCgroupNameSuffix(podUID types.UID) string {
|
||||
return podCgroupNamePrefix + string(podUID)
|
||||
}
|
||||
|
Reference in New Issue
Block a user