cgroup

package
v0.7.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddContainerIDToCache

func AddContainerIDToCache(pid uint64, containerID string)

AddContainerIDToCache add the container id to cache using the pid as the key

func GetAliveContainers

func GetAliveContainers() (map[string]bool, error)

GetAliveContainers returns alive pod map

func GetContainerID

func GetContainerID(cGroupID, pid uint64, withCGroupID bool) (string, error)

func GetContainerIDFromPID

func GetContainerIDFromPID(pid uint64) (string, error)

GetContainerIDFromPID find the container ID using the process PID

func Init

func Init() (*[]corev1.Pod, error)

func ParseContainerIDFromPodStatus

func ParseContainerIDFromPodStatus(containerID string) string

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL