manager

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCPUSetForContainer

func ApplyCPUSetForContainer(podUID, containerId string, data *common.CPUSetData) error

func ApplyCPUSetWithAbsolutePath

func ApplyCPUSetWithAbsolutePath(absCgroupPath string, data *common.CPUSetData) error

func ApplyCPUSetWithRelativePath

func ApplyCPUSetWithRelativePath(relCgroupPath string, data *common.CPUSetData) error

func ApplyCPUWithRelativePath

func ApplyCPUWithRelativePath(relCgroupPath string, data *common.CPUData) error

func ApplyMemoryWithRelativePath

func ApplyMemoryWithRelativePath(relCgroupPath string, data *common.MemoryData) error

func ApplyNetClsForContainer added in v0.2.0

func ApplyNetClsForContainer(podUID, containerId string, data *common.NetClsData) error

ApplyNetClsForContainer applies the net_cls config for a container.

func ApplyNetClsWithAbsolutePath added in v0.2.0

func ApplyNetClsWithAbsolutePath(absCgroupPath string, data *common.NetClsData) error

func ApplyNetClsWithRelativePath

func ApplyNetClsWithRelativePath(relCgroupPath string, data *common.NetClsData) error

func ApplyUnifiedDataForContainer added in v0.3.0

func ApplyUnifiedDataForContainer(podUID, containerId, subsys, cgroupFileName, data string) error

ApplyUnifiedDataForContainer applies the data to cgroupFileName in subsys for a container.

func ApplyUnifiedDataWithAbsolutePath added in v0.3.0

func ApplyUnifiedDataWithAbsolutePath(absCgroupPath, cgroupFileName, data string) error

func DropCacheWithTimeoutForContainer

func DropCacheWithTimeoutForContainer(ctx context.Context, podUID, containerId string, timeoutSecs int) error

func DropCacheWithTimeoutWithRelativePath

func DropCacheWithTimeoutWithRelativePath(timeoutSecs int, absCgroupPath string) error

func GetCPUSetForContainer

func GetCPUSetForContainer(podUID, containerId string) (*common.CPUSetStats, error)

func GetCPUSetWithAbsolutePath

func GetCPUSetWithAbsolutePath(absCgroupPath string) (*common.CPUSetStats, error)

func GetCPUSetWithRelativePath

func GetCPUSetWithRelativePath(relCgroupPath string) (*common.CPUSetStats, error)

func GetCPUWithRelativePath

func GetCPUWithRelativePath(relCgroupPath string) (*common.CPUStats, error)

func GetMemoryWithAbsolutePath

func GetMemoryWithAbsolutePath(absCgroupPath string) (*common.MemoryStats, error)

func GetMemoryWithRelativePath

func GetMemoryWithRelativePath(relCgroupPath string) (*common.MemoryStats, error)

func GetMetricsWithRelativePath

func GetMetricsWithRelativePath(relCgroupPath string, subsystems map[string]struct{}) (*common.CgroupMetrics, error)

func GetPidsWithAbsolutePath

func GetPidsWithAbsolutePath(absCgroupPath string) ([]string, error)

func GetPidsWithRelativePath

func GetPidsWithRelativePath(relCgroupPath string) ([]string, error)

func GetTasksWithAbsolutePath

func GetTasksWithAbsolutePath(absCgroupPath string) ([]string, error)

func GetTasksWithRelativePath

func GetTasksWithRelativePath(cgroupPath, subsys string) ([]string, error)

Types

type Manager

type Manager interface {
	ApplyMemory(absCgroupPath string, data *common.MemoryData) error
	ApplyCPU(absCgroupPath string, data *common.CPUData) error
	ApplyCPUSet(absCgroupPath string, data *common.CPUSetData) error
	ApplyNetCls(absCgroupPath string, data *common.NetClsData) error
	ApplyUnifiedData(absCgroupPath, cgroupFileName, data string) error

	GetMemory(absCgroupPath string) (*common.MemoryStats, error)
	GetCPU(absCgroupPath string) (*common.CPUStats, error)
	GetCPUSet(absCgroupPath string) (*common.CPUSetStats, error)
	GetMetrics(relCgroupPath string, subsystems map[string]struct{}) (*common.CgroupMetrics, error)

	GetPids(absCgroupPath string) ([]string, error)
	GetTasks(absCgroupPath string) ([]string, error)
}

Manager cgroup operation interface for different sub-systems. if v1 and v2 versioned cgroup system will perform different actions, it should be organized in manager; otherwise, implement in general util file instead.

func GetManager

func GetManager() Manager

GetManager returns a cgroup instance for both v1/v2 version

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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