cgroup

package
v1.18.10 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v1.0.13

func Init() error

Types

type CPUStat added in v1.0.6

type CPUStat struct {
	UsageSeconds         float64
	ThrottledTimeSeconds float64
	LimitCores           float64
}

type Cgroup

type Cgroup struct {
	Id            string
	Version       Version
	ContainerType ContainerType
	ContainerId   string
	// contains filtered or unexported fields
}

func NewFromProcessCgroupFile

func NewFromProcessCgroupFile(filePath string) (*Cgroup, error)

func (Cgroup) CpuStat added in v1.0.6

func (cg Cgroup) CpuStat() (*CPUStat, error)

func (*Cgroup) CreatedAt

func (cg *Cgroup) CreatedAt() time.Time

func (*Cgroup) IOStat added in v1.0.6

func (cg *Cgroup) IOStat() (map[string]IOStat, error)

func (*Cgroup) MemoryStat

func (cg *Cgroup) MemoryStat() (*MemoryStat, error)

type ContainerType

type ContainerType uint8
const (
	ContainerTypeUnknown ContainerType = iota
	ContainerTypeStandaloneProcess
	ContainerTypeDocker
	ContainerTypeCrio
	ContainerTypeContainerd
	ContainerTypeLxc
	ContainerTypeSystemdService
	ContainerTypeSandbox
)

func (ContainerType) String

func (t ContainerType) String() string

type IOStat added in v1.0.6

type IOStat struct {
	ReadOps      uint64
	WriteOps     uint64
	ReadBytes    uint64
	WrittenBytes uint64
}

type MemoryStat

type MemoryStat struct {
	RSS   uint64
	Cache uint64
	Limit uint64
}

type Version added in v1.0.6

type Version uint8
const (
	V1 Version = iota
	V2
)

Jump to

Keyboard shortcuts

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