Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CgroupV2 ¶
type CgroupV2 struct {
// contains filtered or unexported fields
}
CgroupV2 manage resource by writing to linux cgroup file. Make sure that the host is using cgroupv2 before using this struct.
func NewCgroupV2 ¶
NewCgroupV2 mkdir in cgroup path by given name.
func (*CgroupV2) AddSubGroup ¶
AddSubGroup will create a cgroup dir in current cgroup then add this to
func (*CgroupV2) Config ¶
func (cg *CgroupV2) Config(config *ResourceConfig) error
Config set the cgroup resource limit.
func (*CgroupV2) Destroy ¶
Destroy remove current cgroup path, include its subcgroups. Do not use the CgroupV2 struct after executing Destroy or return an error.
type ResourceConfig ¶
ResourceConfig records the limits of resource.
type ResourceManager ¶
type ResourceManager interface { Apply(pid int) error Config(*ResourceConfig) error ReadState() (*RunState, error) Destroy() error }
ResourceManager will be created to limit and monitor the resources' usage of processes.
Click to show internal directories.
Click to hide internal directories.