types

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 40

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUStat

type CPUStat struct {
	UsageNanos     *uint64   `json:"usageNanos,omitempty"`
	UserNanos      *uint64   `json:"userNanos,omitempty"`
	SystemNanos    *uint64   `json:"systemNanos,omitempty"`
	NrPeriods      *uint32   `json:"nrPeriods,omitempty"`
	NrThrottled    *uint32   `json:"nrThrottled,omitempty"`
	ThrottledNanos *uint64   `json:"throttledNanos,omitempty"`
	Pressure       *Pressure `json:"pressure,omitempty"`
}

CPUStat represents the sampling state of the cgroupv2 CPU controller

type IOStat

type IOStat struct {
	ReadBytes    *uint64   `json:"readBytes,omitempty"`
	WriteBytes   *uint64   `json:"writeBytes,omitempty"`
	DiscardBytes *uint64   `json:"discardBytes,omitempty"`
	ReadIOs      *uint64   `json:"readIOs,omitempty"`
	WriteIOs     *uint64   `json:"writeIOs,omitempty"`
	DiscardIOs   *uint64   `json:"discardIOs,omitempty"`
	Pressure     *Pressure `json:"pressure,omitempty"`
}

IOStat represents the sampling state of the cgroupv2 IO controller

type MemoryStat

type MemoryStat struct {
	SwapBytes     *uint64   `json:"swapBytes,omitempty"`
	Anon          *uint64   `json:"anon,omitempty"`
	File          *uint64   `json:"file,omitempty"`
	Kernel        *uint64   `json:"kernel,omitempty"`
	KernelStack   *uint64   `json:"kernelStack,omitempty"`
	PageTables    *uint64   `json:"pageTables,omitempty"`
	Sock          *uint64   `json:"sock,omitempty"`
	Vmalloc       *uint64   `json:"vmalloc,omitempty"`
	Shmem         *uint64   `json:"shmem,omitempty"`
	FileMapped    *uint64   `json:"fileMapped,omitempty"`
	FileDirty     *uint64   `json:"fileDirty,omitempty"`
	FileWriteback *uint64   `json:"fileWriteback,omitempty"`
	Slab          *uint64   `json:"slab,omitempty"`
	Pgscan        *uint64   `json:"pgscan,omitempty"`
	Pgsteal       *uint64   `json:"pgsteal,omitempty"`
	Pgfault       *uint64   `json:"pgfault,omitempty"`
	Pgmajfault    *uint64   `json:"pgmajfault,omitempty"`
	Peak          *uint64   `json:"peak,omitempty"`
	LowEvents     uint64    `json:"lowEvents,omitempty"`
	HighEvents    uint64    `json:"highEvents,omitempty"`
	MaxEvents     uint64    `json:"maxEvents,omitempty"`
	OomEvents     uint64    `json:"oomEvents,omitempty"`
	OomKillEvents uint64    `json:"oomKillEvents,omitempty"`
	Pressure      *Pressure `json:"pressure,omitempty"`
}

MemoryStat represents the sampling state of the cgroupv2 memory controller

type NetworkSample added in v0.13.0

type NetworkSample struct {
	RxBytes   int64 `json:"rxBytes,omitempty"`
	RxPackets int64 `json:"rxPackets,omitempty"`
	RxErrors  int64 `json:"rxErrors,omitempty"`
	RxDropped int64 `json:"rxDropped,omitempty"`
	TxBytes   int64 `json:"txBytes,omitempty"`
	TxPackets int64 `json:"txPackets,omitempty"`
	TxErrors  int64 `json:"txErrors,omitempty"`
	TxDropped int64 `json:"txDropped,omitempty"`
}

type PIDsStat

type PIDsStat struct {
	Current *uint64 `json:"current,omitempty"`
}

PIDsStat represents the sampling state of the cgroupv2 PIDs controller

type Pressure

type Pressure struct {
	Some *PressureValues `json:"some"`
	Full *PressureValues `json:"full"`
}

Pressure represents the sampling state of pressure files

type PressureValues

type PressureValues struct {
	Avg10  *float64 `json:"avg10"`
	Avg60  *float64 `json:"avg60"`
	Avg300 *float64 `json:"avg300"`
	Total  *uint64  `json:"total"`
}

type ProcStat

type ProcStat struct {
	ContextSwitches  uint64 `json:"contextSwitches"`
	ProcessCreated   uint64 `json:"processCreated"`
	ProcessesRunning uint64 `json:"processesRunning"`
}

type Recorder

type Recorder interface {
	Start()
	Close()
	CloseAsync(func(context.Context) error) error
	Wait() error
	Samples() (*Samples, error)
}

type Sample

type Sample struct {
	//nolint
	Timestamp_ time.Time      `json:"timestamp"`
	CPUStat    *CPUStat       `json:"cpuStat,omitempty"`
	MemoryStat *MemoryStat    `json:"memoryStat,omitempty"`
	IOStat     *IOStat        `json:"ioStat,omitempty"`
	PIDsStat   *PIDsStat      `json:"pidsStat,omitempty"`
	NetStat    *NetworkSample `json:"netStat,omitempty"`
}

Sample represents a wrapper for sampled data of cgroupv2 controllers

func (*Sample) Timestamp

func (s *Sample) Timestamp() time.Time

type Samples

type Samples struct {
	Samples    []*Sample   `json:"samples,omitempty"`
	SysCPUStat *SysCPUStat `json:"sysCPUStat,omitempty"`
}

type SysCPUStat

type SysCPUStat struct {
	User      float64 `json:"user"`
	Nice      float64 `json:"nice"`
	System    float64 `json:"system"`
	Idle      float64 `json:"idle"`
	Iowait    float64 `json:"iowait"`
	IRQ       float64 `json:"irq"`
	SoftIRQ   float64 `json:"softirq"`
	Steal     float64 `json:"steal"`
	Guest     float64 `json:"guest"`
	GuestNice float64 `json:"guestNice"`
}

func (SysCPUStat) MarshalJSON

func (s SysCPUStat) MarshalJSON() ([]byte, error)

type SysMemoryStat

type SysMemoryStat struct {
	Total     *uint64 `json:"total"`
	Free      *uint64 `json:"free"`
	Available *uint64 `json:"available"`
	Buffers   *uint64 `json:"buffers"`
	Cached    *uint64 `json:"cached"`
	Active    *uint64 `json:"active"`
	Inactive  *uint64 `json:"inactive"`
	Swap      *uint64 `json:"swap"`
	Dirty     *uint64 `json:"dirty"`
	Writeback *uint64 `json:"writeback"`
	Slab      *uint64 `json:"slab"`
}

type SysSample

type SysSample struct {
	//nolint
	Timestamp_     time.Time      `json:"timestamp"`
	CPUStat        *SysCPUStat    `json:"cpuStat,omitempty"`
	ProcStat       *ProcStat      `json:"procStat,omitempty"`
	MemoryStat     *SysMemoryStat `json:"memoryStat,omitempty"`
	CPUPressure    *Pressure      `json:"cpuPressure,omitempty"`
	MemoryPressure *Pressure      `json:"memoryPressure,omitempty"`
	IOPressure     *Pressure      `json:"ioPressure,omitempty"`
}

func (*SysSample) Timestamp

func (s *SysSample) Timestamp() time.Time

Jump to

Keyboard shortcuts

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