controller_cgroup

package
v0.0.0-...-5fda629 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MulanPSL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCgroupPathTypeDocker

func GetCgroupPathTypeDocker(containerId string) (string, error)

func GetCgroupPathTypeSystem

func GetCgroupPathTypeSystem(containerId string) (string, error)

cgroupPath 指 subsystems 的相对路径,如/sys/fs/cgroup/cpu/ 目录下的相对路径 /test 在Ubuntu中,对于容器而言,相对路径即 /docker/{containerID<no-trunc>}

Types

type ControllerCgroup

type ControllerCgroup struct {
	// contains filtered or unexported fields
}

func NewControllerCgroup

func NewControllerCgroup(context context.Context, pathType string) (*ControllerCgroup, error)

func (*ControllerCgroup) GetCgroupPath

func (c *ControllerCgroup) GetCgroupPath(containerId string) (string, error)

func (*ControllerCgroup) UpdateCpuResources

func (c *ControllerCgroup) UpdateCpuResources(cgroupPath string, ratio float64) error

func (*ControllerCgroup) UpdateCpuSets

func (c *ControllerCgroup) UpdateCpuSets(cgroupPath, cpuSet string) error

func (*ControllerCgroup) UpdateCpuShares

func (c *ControllerCgroup) UpdateCpuShares(cgroupPaths []string, ratio []int) error

func (*ControllerCgroup) UpdateMemResources

func (c *ControllerCgroup) UpdateMemResources() error

todo control memory resources

func (*ControllerCgroup) UpdateNetResources

func (c *ControllerCgroup) UpdateNetResources(cgroupPath string) error

使用 classId 区分数据包

type GetContainerCgroupPath

type GetContainerCgroupPath func(containerID string) (string, error)

Jump to

Keyboard shortcuts

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