cgroup

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPeriodCPU = uint64(100000)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CGroup

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

func NewCGroup

func NewCGroup(options ...Option) *CGroup

func (*CGroup) Stat

func (cgroup *CGroup) Stat() (*Stat, error)

type CPU

type CPU struct {
	Version Version
	Limit   uint64
	Period  uint64
}

type Cpuacct

type Cpuacct struct {
	Version Version
	Usage   uint64
}

type Memory

type Memory struct {
	Version Version
	Limit   uint64
	Usage   uint64
}

type Option

type Option func(cgroup *CGroup)

func WithMountinfoParser

func WithMountinfoParser(mountinfo *mountinfo.Parser) Option

func WithOnlyVersion

func WithOnlyVersion(versions ...Version) Option

func WithPID

func WithPID(pid uint64) Option

func WithSubsystemParser

func WithSubsystemParser(subsystem *subsystem.Parser) Option

func WithVersionOrder

func WithVersionOrder(versions ...Version) Option

type Stat

type Stat struct {
	CPU     *CPU
	Cpuacct *Cpuacct
	Memory  *Memory
}

func LoaderV1

func LoaderV1(subsystems *linker.Linker[subsystem.Name, *subsystem.Subsystem], mountPoints set.Set[*mountinfo.Point], stat *Stat) (*Stat, error)

func LoaderV2

func LoaderV2(subsystems *linker.Linker[subsystem.Name, *subsystem.Subsystem], _ set.Set[*mountinfo.Point], stat *Stat) (*Stat, error)

type Version

type Version uint8
const (
	CGroupV1 Version = iota
	CGroupV2
)

func (Version) String

func (i Version) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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