fs

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type CpuSubsystem

type CpuSubsystem struct{}

func (*CpuSubsystem) Apply

func (s *CpuSubsystem) Apply(path string, r *config.Resources, pid int) error

func (*CpuSubsystem) Name

func (s *CpuSubsystem) Name() string

func (*CpuSubsystem) Set

func (s *CpuSubsystem) Set(path string, r *config.Resources) error

func (*CpuSubsystem) SetRtSched

func (s *CpuSubsystem) SetRtSched(path string, r *config.Resources) error

type CpusetSubsystem

type CpusetSubsystem struct{}

func (*CpusetSubsystem) Apply

func (s *CpusetSubsystem) Apply(path string, r *config.Resources, pid int) error

func (*CpusetSubsystem) ApplyDir

func (s *CpusetSubsystem) ApplyDir(dir string, r *config.Resources, pid int) error

func (*CpusetSubsystem) Name

func (s *CpusetSubsystem) Name() string

func (*CpusetSubsystem) Set

func (s *CpusetSubsystem) Set(path string, r *config.Resources) error

type Manager

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

func NewManager

func NewManager(cg *config.Cgroup, paths map[string]string) (*Manager, error)

func (*Manager) Apply

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

func (*Manager) Destroy

func (m *Manager) Destroy() error

func (*Manager) GetCgroups

func (m *Manager) GetCgroups() (*config.Cgroup, error)

func (*Manager) Path

func (m *Manager) Path(subsys string) string

func (*Manager) Set

func (m *Manager) Set(r *config.Resources) error

type MemorySubsystem

type MemorySubsystem struct{}

func (*MemorySubsystem) Apply

func (s *MemorySubsystem) Apply(path string, _ *config.Resources, pid int) error

func (*MemorySubsystem) Name

func (s *MemorySubsystem) Name() string

func (*MemorySubsystem) Set

func (s *MemorySubsystem) Set(path string, r *config.Resources) error

type Subsystem

type Subsystem interface {
	// Name 返回当前Subsystem的名称,比如cpu、memory
	Name() string
	// Set 设置某个cgroup在这个Subsystem中的资源限制
	Set(path string, res *config.Resources) error
	// Apply 将进程添加到某个cgroup中
	Apply(path string, r *config.Resources, pid int) error
}

Jump to

Keyboard shortcuts

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