cgroups

package
v0.0.0-...-8deac7e Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GoodCgroupName = "good"
	BadCgroupName  = "bad"
)
View Source
const (
	Root   = "/sys/fs/cgroup"
	Garden = "garden"
	Header = "#subsys_name hierarchy num_cgroups enabled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUCgrouper

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

func NewCPUCgrouper

func NewCPUCgrouper(cgroupRoot string) CPUCgrouper

func (CPUCgrouper) CreateBadCgroup

func (c CPUCgrouper) CreateBadCgroup(handle string) error

func (CPUCgrouper) DestroyBadCgroup

func (c CPUCgrouper) DestroyBadCgroup(handle string) error

func (CPUCgrouper) ReadBadCgroupUsage

func (c CPUCgrouper) ReadBadCgroupUsage(handle string) (garden.ContainerCPUStat, error)

type CgroupStarter

type CgroupStarter struct {
	CgroupPath      string
	GardenCgroup    string
	AllowedDevices  []specs.LinuxDeviceCgroup
	ProcCgroups     io.ReadCloser
	ProcSelfCgroups io.ReadCloser
	CPUThrottling   bool

	Logger            lager.Logger
	MountPointChecker rundmc.MountPointChecker
	FS                fs.FS
	// contains filtered or unexported fields
}

func NewStarter

func NewStarter(
	logger lager.Logger,
	procCgroupReader io.ReadCloser,
	procSelfCgroupReader io.ReadCloser,
	cgroupMountpoint string,
	gardenCgroup string,
	allowedDevices []specs.LinuxDeviceCgroup,
	mountPointChecker rundmc.MountPointChecker,
	enableCPUThrottling bool,
) *CgroupStarter

func (*CgroupStarter) Start

func (s *CgroupStarter) Start() error

func (*CgroupStarter) WithGID

func (s *CgroupStarter) WithGID(gid int) *CgroupStarter

func (*CgroupStarter) WithUID

func (s *CgroupStarter) WithUID(uid int) *CgroupStarter

type CgroupsFormatError

type CgroupsFormatError struct {
	Content string
}

func (CgroupsFormatError) Error

func (err CgroupsFormatError) Error() string

type NoopCPUCgrouper

type NoopCPUCgrouper struct{}

func (NoopCPUCgrouper) CreateBadCgroup

func (NoopCPUCgrouper) CreateBadCgroup(string) error

func (NoopCPUCgrouper) DestroyBadCgroup

func (NoopCPUCgrouper) DestroyBadCgroup(string) error

func (NoopCPUCgrouper) ReadBadCgroupUsage

func (NoopCPUCgrouper) ReadBadCgroupUsage(string) (garden.ContainerCPUStat, error)

Directories

Path Synopsis
fs
fsfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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