Documentation ¶
Index ¶
- func AddContainerIDToCache(pid uint64, containerID string)
- func GetAliveContainers() (map[string]bool, error)
- func GetContainerID(cGroupID, pid uint64, withCGroupID bool) (string, error)
- func GetContainerIDFromPID(pid uint64) (string, error)
- func Init() (*[]corev1.Pod, error)
- func ParseContainerIDFromPodStatus(containerID string) string
- type CCgroupStatHandler
- type CCgroupV1StatManager
- type CCgroupV2StatManager
- type ContainerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddContainerIDToCache ¶
AddContainerIDToCache add the container id to cache using the pid as the key
func GetAliveContainers ¶
GetAliveContainers returns alive pod map
func GetContainerIDFromPID ¶
GetContainerIDFromPID find the container ID using the process PID
Types ¶
type CCgroupStatHandler ¶ added in v0.5.1
type CCgroupStatHandler interface {
SetCGroupStat(containerID string, CgroupStatMap map[string]*types.UInt64StatCollection) error
}
func NewCGroupStatManager ¶ added in v0.5.1
func NewCGroupStatManager(pid int) (CCgroupStatHandler, error)
NewCGroupStatManager creates a new cgroup stat object that can return the current metrics of the cgroup To avoid casting of interfaces, the CCgroupStatHandler has a handler for cgroup V1 or V2. See comments here: https://github.com/sustainable-computing-io/kepler/pull/609#discussion_r1155043868
type CCgroupV1StatManager ¶ added in v0.5.1
type CCgroupV1StatManager struct {
// contains filtered or unexported fields
}
func (CCgroupV1StatManager) SetCGroupStat ¶ added in v0.5.1
func (c CCgroupV1StatManager) SetCGroupStat(containerID string, cgroupStatMap map[string]*types.UInt64StatCollection) error
type CCgroupV2StatManager ¶ added in v0.5.1
type CCgroupV2StatManager struct {
// contains filtered or unexported fields
}
func (CCgroupV2StatManager) SetCGroupStat ¶ added in v0.5.1
func (c CCgroupV2StatManager) SetCGroupStat(containerID string, cgroupStatMap map[string]*types.UInt64StatCollection) error
type ContainerInfo ¶
type ContainerInfo struct { ContainerID string ContainerName string PodName string Namespace string }
func GetContainerInfo ¶ added in v0.5.1
func GetContainerInfo(cGroupID, pid uint64, withCGroupID bool) (*ContainerInfo, error)
Click to show internal directories.
Click to hide internal directories.