cgroup

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlkioStat

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

type Cgroup

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

func NewFromProcessCgroupFile

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

func (*Cgroup) BlkioStat

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

func (Cgroup) CpuQuotaCores

func (cg Cgroup) CpuQuotaCores() (float64, error)

func (Cgroup) CpuUsageSeconds

func (cg Cgroup) CpuUsageSeconds() (float64, error)

func (*Cgroup) CreatedAt

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

func (*Cgroup) GetStats

func (cg *Cgroup) GetStats() *Stats

func (*Cgroup) MemoryLimitBytes

func (cg *Cgroup) MemoryLimitBytes() (uint64, error)

func (*Cgroup) MemoryStat

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

func (Cgroup) ThrottledTimeSeconds

func (cg Cgroup) ThrottledTimeSeconds() (float64, error)

type ContainerType

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

func (ContainerType) String

func (t ContainerType) String() string

type MemoryStat

type MemoryStat struct {
	RSS   uint64
	Cache uint64
}

type Stats

type Stats struct {
	CpuUsageSeconds      float64
	ThrottledTimeSeconds float64
	CpuQuotaCores        float64

	MemoryRssBytes   float64
	MemoryCacheBytes float64
	MemoryLimitBytes float64

	Blkio map[string]BlkioStat
}

type ThrottlingStat

type ThrottlingStat struct {
	Periods              uint64
	ThrottledPeriods     uint64
	ThrottledTimeSeconds float64
}

Jump to

Keyboard shortcuts

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