subsystems

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SubsystemsIns = []Subsystem{
		&CpuLimitSubSystem{},
		&MemorySubSystem{},
		&CpuSubSystem{},
	}
)

Functions

func FindCgroupMountpoint

func FindCgroupMountpoint(subsystem string) string

func GetCgroupPath

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

func InitLog

func InitLog(logger *zap.SugaredLogger)

Types

type CpuLimitSubSystem

type CpuLimitSubSystem struct {
}

func (*CpuLimitSubSystem) Apply

func (s *CpuLimitSubSystem) Apply(cgroupPath string, pid int) error

func (*CpuLimitSubSystem) Name

func (s *CpuLimitSubSystem) Name() string

func (*CpuLimitSubSystem) Remove

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

func (*CpuLimitSubSystem) Set

func (s *CpuLimitSubSystem) Set(cgroupPath string, res *ResourceConfig) error

type CpuSubSystem

type CpuSubSystem struct {
}

func (*CpuSubSystem) Apply

func (s *CpuSubSystem) Apply(cgroupPath string, pid int) 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, res *ResourceConfig) error

type MemorySubSystem

type MemorySubSystem struct {
}

func (*MemorySubSystem) Apply

func (s *MemorySubSystem) Apply(cgroupPath string, pid int) error

func (*MemorySubSystem) Name

func (s *MemorySubSystem) Name() string

func (*MemorySubSystem) Remove

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

func (*MemorySubSystem) Set

func (s *MemorySubSystem) Set(cgroupPath string, res *ResourceConfig) error

type ResourceConfig

type ResourceConfig struct {
	MemoryLimit string
	CpuPeriod   string
	CpuQuota    string
	CpuSet      string
}

type Subsystem

type Subsystem interface {
	Name() string
	Set(path string, res *ResourceConfig) error
	Apply(path string, pid int) error
	Remove(path string) error
}

Jump to

Keyboard shortcuts

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