subsystem

package
v0.0.0-...-2016d95 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindCgroupMountPoint

func FindCgroupMountPoint(subsystem string) (string, error)

FindCgroupMountPoint finds the Cgroup mount point of subsystem.

func GetCgroupPath

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

GetCgroupPath get the Cgroup path of the subsystem.

Types

type Manager

type Manager struct {
	Path     string
	Resource *ResourceConfig
}

func NewManager

func NewManager(path string) *Manager

func (*Manager) Apply

func (m *Manager) Apply(pid int) error

func (*Manager) Destroy

func (m *Manager) Destroy() error

func (*Manager) Set

func (m *Manager) Set(res *ResourceConfig) error

type MemorySubsystem

type MemorySubsystem struct {
}

func (*MemorySubsystem) Apply

func (m *MemorySubsystem) Apply(cpath string, pid int) error

func (*MemorySubsystem) Name

func (m *MemorySubsystem) Name() string

Name returns the name of subsystem.

func (*MemorySubsystem) Remove

func (m *MemorySubsystem) Remove(cpath string) error

func (*MemorySubsystem) Set

func (m *MemorySubsystem) Set(cpath string, res *ResourceConfig) error

type ResourceConfig

type ResourceConfig struct {
	MemoryLimit string
	CpuShare    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