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: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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