manager

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 17 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 ApplyIOCostModelWithAbsolutePath added in v0.4.0

func ApplyIOCostModelWithAbsolutePath(absCgroupPath string, devID string, data *common.IOCostModelData) error

func ApplyIOCostModelWithRelativePath added in v0.4.0

func ApplyIOCostModelWithRelativePath(relCgroupPath string, devID string, data *common.IOCostModelData) error

func ApplyIOCostQoSWithAbsolutePath added in v0.4.0

func ApplyIOCostQoSWithAbsolutePath(absCgroupPath string, devID string, data *common.IOCostQoSData) error

func ApplyIOCostQoSWithRelativePath added in v0.4.0

func ApplyIOCostQoSWithRelativePath(relCgroupPath string, devID string, data *common.IOCostQoSData) error

func ApplyIOWeightWithAbsolutePath added in v0.4.0

func ApplyIOWeightWithAbsolutePath(absCgroupPath string, devID string, weight uint64) error

func ApplyIOWeightWithRelativePath added in v0.4.0

func ApplyIOWeightWithRelativePath(relCgroupPath string, devID string, weight uint64) 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 DisableSwapMaxWithAbsolutePathRecursive added in v0.5.1

func DisableSwapMaxWithAbsolutePathRecursive(absCgroupPath string) error

func DropCacheWithTimeoutAndAbsCGPath added in v0.5.1

func DropCacheWithTimeoutAndAbsCGPath(timeoutSecs int, absCgroupPath string, nbytes int64) error

func DropCacheWithTimeoutForContainer

func DropCacheWithTimeoutForContainer(ctx context.Context, podUID, containerId string, timeoutSecs int, nbytes int64) 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 GetDeviceIOWeightWithAbsolutePath added in v0.4.0

func GetDeviceIOWeightWithAbsolutePath(absCgroupPath, devID string) (uint64, bool, error)

func GetDeviceIOWeightWithRelativePath added in v0.4.0

func GetDeviceIOWeightWithRelativePath(relCgroupPath, devID string) (uint64, bool, error)

func GetIOCostModelWithAbsolutePath added in v0.4.0

func GetIOCostModelWithAbsolutePath(absCgroupPath string) (map[string]*common.IOCostModelData, error)

func GetIOCostModelWithRelativePath added in v0.4.0

func GetIOCostModelWithRelativePath(relCgroupPath string) (map[string]*common.IOCostModelData, error)

func GetIOCostQoSWithAbsolutePath added in v0.4.0

func GetIOCostQoSWithAbsolutePath(absCgroupPath string) (map[string]*common.IOCostQoSData, error)

func GetIOCostQoSWithRelativePath added in v0.4.0

func GetIOCostQoSWithRelativePath(relCgroupPath string) (map[string]*common.IOCostQoSData, error)

func GetIOStatWithAbsolutePath added in v0.4.0

func GetIOStatWithAbsolutePath(absCgroupPath string) (map[string]map[string]string, error)

func GetIOStatWithRelativePath added in v0.4.0

func GetIOStatWithRelativePath(relCgroupPath string) (map[string]map[string]string, 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)

func MemoryOffloadingWithAbsolutePath added in v0.5.1

func MemoryOffloadingWithAbsolutePath(ctx context.Context, absCgroupPath string, nbytes int64) error

func SetExtraCGMemLimitWithTimeoutAndAbsCGPath added in v0.5.1

func SetExtraCGMemLimitWithTimeoutAndAbsCGPath(timeoutSecs int, absCgroupPath string, nbytes int64) error

func SetExtraCGMemLimitWithTimeoutAndRelCGPath added in v0.5.1

func SetExtraCGMemLimitWithTimeoutAndRelCGPath(ctx context.Context, relCgroupPath string, timeoutSecs int, nbytes int64) error

func SetSwapMaxWithAbsolutePathRecursive added in v0.5.1

func SetSwapMaxWithAbsolutePathRecursive(absCgroupPath string) error

func SetSwapMaxWithAbsolutePathToParentCgroupRecursive added in v0.5.1

func SetSwapMaxWithAbsolutePathToParentCgroupRecursive(absCgroupPath string) error

Types

type FakeCgroupManager added in v0.4.0

type FakeCgroupManager struct{}

func (*FakeCgroupManager) ApplyCPU added in v0.4.0

func (f *FakeCgroupManager) ApplyCPU(absCgroupPath string, data *common.CPUData) error

func (*FakeCgroupManager) ApplyCPUSet added in v0.4.0

func (f *FakeCgroupManager) ApplyCPUSet(absCgroupPath string, data *common.CPUSetData) error

func (*FakeCgroupManager) ApplyIOCostModel added in v0.4.0

func (f *FakeCgroupManager) ApplyIOCostModel(absCgroupPath string, devID string, data *common.IOCostModelData) error

func (*FakeCgroupManager) ApplyIOCostQoS added in v0.4.0

func (f *FakeCgroupManager) ApplyIOCostQoS(absCgroupPath string, devID string, data *common.IOCostQoSData) error

func (*FakeCgroupManager) ApplyIOWeight added in v0.4.0

func (f *FakeCgroupManager) ApplyIOWeight(absCgroupPath string, devID string, weight uint64) error

func (*FakeCgroupManager) ApplyMemory added in v0.4.0

func (f *FakeCgroupManager) ApplyMemory(absCgroupPath string, data *common.MemoryData) error

func (*FakeCgroupManager) ApplyNetCls added in v0.4.0

func (f *FakeCgroupManager) ApplyNetCls(absCgroupPath string, data *common.NetClsData) error

func (*FakeCgroupManager) ApplyUnifiedData added in v0.4.0

func (f *FakeCgroupManager) ApplyUnifiedData(absCgroupPath, cgroupFileName, data string) error

func (*FakeCgroupManager) GetCPU added in v0.4.0

func (f *FakeCgroupManager) GetCPU(absCgroupPath string) (*common.CPUStats, error)

func (*FakeCgroupManager) GetCPUSet added in v0.4.0

func (f *FakeCgroupManager) GetCPUSet(absCgroupPath string) (*common.CPUSetStats, error)

func (*FakeCgroupManager) GetDeviceIOWeight added in v0.4.0

func (f *FakeCgroupManager) GetDeviceIOWeight(absCgroupPath string, devID string) (uint64, bool, error)

func (*FakeCgroupManager) GetIOCostModel added in v0.4.0

func (f *FakeCgroupManager) GetIOCostModel(absCgroupPath string) (map[string]*common.IOCostModelData, error)

func (*FakeCgroupManager) GetIOCostQoS added in v0.4.0

func (f *FakeCgroupManager) GetIOCostQoS(absCgroupPath string) (map[string]*common.IOCostQoSData, error)

func (*FakeCgroupManager) GetIOStat added in v0.4.0

func (f *FakeCgroupManager) GetIOStat(absCgroupPath string) (map[string]map[string]string, error)

func (*FakeCgroupManager) GetMemory added in v0.4.0

func (f *FakeCgroupManager) GetMemory(absCgroupPath string) (*common.MemoryStats, error)

func (*FakeCgroupManager) GetMetrics added in v0.4.0

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

func (*FakeCgroupManager) GetNumaMemory added in v0.4.1

func (f *FakeCgroupManager) GetNumaMemory(absCgroupPath string) (map[int]*common.MemoryNumaMetrics, error)

func (*FakeCgroupManager) GetPids added in v0.4.0

func (f *FakeCgroupManager) GetPids(absCgroupPath string) ([]string, error)

func (*FakeCgroupManager) GetTasks added in v0.4.0

func (f *FakeCgroupManager) GetTasks(absCgroupPath string) ([]string, error)

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
	ApplyIOCostQoS(absCgroupPath string, devID string, data *common.IOCostQoSData) error
	ApplyIOCostModel(absCgroupPath string, devID string, data *common.IOCostModelData) error
	ApplyIOWeight(absCgroupPath string, devID string, weight uint64) error
	ApplyUnifiedData(absCgroupPath, cgroupFileName, data string) error

	GetMemory(absCgroupPath string) (*common.MemoryStats, error)
	GetNumaMemory(absCgroupPath string) (map[int]*common.MemoryNumaMetrics, error)
	GetCPU(absCgroupPath string) (*common.CPUStats, error)
	GetCPUSet(absCgroupPath string) (*common.CPUSetStats, error)
	GetIOCostQoS(absCgroupPath string) (map[string]*common.IOCostQoSData, error)
	GetIOCostModel(absCgroupPath string) (map[string]*common.IOCostModelData, error)
	GetDeviceIOWeight(absCgroupPath string, devID string) (uint64, bool, error)
	GetIOStat(absCgroupPath string) (map[string]map[string]string, 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