subsystem

package
v0.0.0-...-1cebe21 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PeriodDefault = 100000
	Percent       = 100
)

Variables

View Source
var SupportedSubSystems = []Subsystem{
	&CpusetSubSystem{},
	&MemorySubSystem{},
	&CpuSubSystem{},
}

Functions

func GetCgroupPath

func GetCgroupPath(subsystem string, cgroupPath string, autoCreate bool) (string, error)

Types

type CpuSubSystem

type CpuSubSystem struct {
}

func (*CpuSubSystem) Apply

func (s *CpuSubSystem) Apply(cgroupPath string, pid int, config *common.CgroupParam) error

func (*CpuSubSystem) Name

func (s *CpuSubSystem) Name() string

func (*CpuSubSystem) Remove

func (s *CpuSubSystem) Remove(cgroupPath string) error

func (*CpuSubSystem) Set

func (s *CpuSubSystem) Set(cgroupPath string, config *common.CgroupParam) error

type CpusetSubSystem

type CpusetSubSystem struct {
}

func (*CpusetSubSystem) Apply

func (s *CpusetSubSystem) Apply(cgroupPath string, pid int, config *common.CgroupParam) error

func (*CpusetSubSystem) Name

func (s *CpusetSubSystem) Name() string

func (*CpusetSubSystem) Remove

func (s *CpusetSubSystem) Remove(cgroupPath string) error

func (*CpusetSubSystem) Set

func (s *CpusetSubSystem) Set(cgroupPath string, config *common.CgroupParam) error

type MemorySubSystem

type MemorySubSystem struct {
}

func (*MemorySubSystem) Apply

func (s *MemorySubSystem) Apply(cgroupPath string, pid int, config *common.CgroupParam) error

func (*MemorySubSystem) Name

func (s *MemorySubSystem) Name() string

Name 返回cgroup名字

func (*MemorySubSystem) Remove

func (s *MemorySubSystem) Remove(cgroupPath string) error

func (*MemorySubSystem) Set

func (s *MemorySubSystem) Set(cgroupPath string, config *common.CgroupParam) error

type Subsystem

type Subsystem interface {
	Name() string
	Set(path string, config *common.CgroupParam) error
	Apply(path string, pid int, config *common.CgroupParam) error
	Remove(path string) error
}

Jump to

Keyboard shortcuts

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