model

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllCgroupFields = []string{"Path", "Name", "Level", "Inode", "Controllers",
	"NrDescendants", "NrDyingDescendants",
	"UsagePercent", "UserPercent", "SystemPercent", "NrPeriodsPerSec", "NrThrottledPerSec", "ThrottledPercent", "NrBurstsPerSec", "BurstPercent",
	"Anon", "File", "KernelStack", "Slab", "Sock", "Shmem", "Zswap", "Zswapped", "FileMapped",
	"FileDirty", "FileWriteback", "AnonThp", "InactiveAnon", "ActiveAnon", "InactiveFile", "ActiveFile", "Unevictable",
	"SlabReclaimable", "SlabUnreclaimable", "Pgfault", "Pgmajfault", "WorkingsetRefault", "WorkingsetActivate",
	"WorkingsetNodereclaim", "Pgrefill", "Pgscan", "Pgsteal", "Pgactivate", "Pgdeactivate", "Pglazyfree", "Pglazyfreed",
	"ZswpIn", "ZswpOut", "ThpFaultAlloc", "ThpCollapseAlloc",
	"CpuSetCpus", "CpuSetCpusEffective", "CpuSetMems", "CpuSetMemsEffective", "CpuWeight", "CpuMax",
	"MemoryCurrent", "MemoryLow", "MemoryHigh", "MemoryMin", "MemoryMax", "MemoryPeak", "SwapCurrent", "SwapMax",
	"ZswapCurrent", "ZswapMax", "EventLow", "EventHigh", "EventMax", "EventOom", "EventOomKill",
	"RbytePerSec", "WbytePerSec", "RioPerSec", "WioPerSec", "DbytePerSec", "DioPerSec",
	"CPUSomePressure", "CPUFullPressure", "MemorySomePressure", "MemoryFullPressure", "IOSomePressure", "IOFullPressure"}
View Source
var AllProcessFields = []string{"Pid", "Comm", "State", "Ppid", "NumThreads", "StartTime", "OnCPU", "CmdLine", "Cgroup",
	"User", "System", "Priority", "Nice", "CPU",
	"MinFlt", "MajFlt", "VSize", "RSS", "Mem",
	"ReadCharPerSec", "WriteCharPerSec",
	"SyscRPerSec", "SyscWPerSec",
	"ReadBytePerSec", "WriteBytePerSec", "CancelledWriteBytePerSec", "Disk"}
View Source
var DefaultCPUFields = []string{
	"Index", "User", "Nice",
	"System", "Idle", "Iowait", "IRQ",
	"SoftIRQ", "Steal", "Guest", "GuestNice",
}
View Source
var DefaultCgroupFields = []string{"Name", "NrDescendants", "NrDyingDescendants", "UsagePercent", "Controllers"}
View Source
var DefaultDiskFields = []string{
	"Disk", "Util",
	"ReadPerSec", "ReadBytePerSec", "WritePerSec", "WriteBytePerSec",
	"AvgIOSize", "AvgQueueLen", "InFlight", "AvgIOWait", "AvgIOTime",
}
View Source
var DefaultMEMFields = []string{
	"MemTotal", "MemFree", "MemAvailable",
	"Buffers", "Cached", "SwapCached", "Active",
	"Inactive", "ActiveAnon", "InactiveAnon", "Unevictable",
	"Mlocked", "SwapTotal", "SwapFree", "Dirty",
	"Writeback", "AnonPages", "Mapped", "Shmem",
	"Slab", "SReclaimable", "SUnreclaim", "KernelStack",
	"PageTables", "NFSUnstable", "Bounce", "WritebackTmp",
	"CommitLimit", "CommittedAS", "VmallocTotal", "VmallocUsed",
	"VmallocChunk", "HardwareCorrupted", "AnonHugePages", "ShmemHugePages",
	"ShmemPmdMapped", "CmaTotal", "CmaFree", "HugePagesTotal",
	"HugePagesFree", "HugePagesRsvd", "HugePagesSurp", "Hugepagesize",
	"DirectMap4k", "DirectMap2M", "DirectMap1G",
}
View Source
var DefaultNetDevFields = []string{
	"Name",
	"RxPacketPerSec", "TxPacketPerSec",
	"RxBytePerSec", "TxBytePerSec",
	"RxErrors", "RxDropped", "RxFIFO", "RxFrame",
	"TxErrors", "TxDropped", "TxFIFO", "TxCollisions",
}
View Source
var DefaultNetProtocolFields = []string{"Name", "Sockets", "Memory"}
View Source
var (
	DefaultNetStatFields = map[string][]string{
		"tcp": {"TcpActiveOpens", "TcpPassiveOpens", "TcpAttemptFails",
			"TcpEstabResets", "TcpCurrEstab", "TcpRetransSegs", "TcpInErrs", "TcpInCsumErrors"},
		"ip": {"IpInReceives", "IpInHdrErrors", "IpInAddrErrors",
			"IpForwDatagrams", "IpInUnknownProtos", "IpInDiscards",
			"IpInDelivers", "IpOutRequests", "IpOutDiscards",
			"IpOutNoRoutes", "IpReasmTimeout", "IpReasmReqds",
			"IpReasmOKs", "IpReasmFails"},
	}
)
View Source
var DefaultProcessFields = []string{"Pid", "Comm", "State", "CPU", "Mem", "ReadBytePerSec", "WriteBytePerSec"}
View Source
var DefaultSoftnetFields = []string{"CPU", "Processed", "Dropped",
	"TimeSqueezed", "CPUCollision", "ReceivedRps", "FlowLimitCount", "SoftnetBacklogLen"}
View Source
var DefaultSystemFields = []string{"Load1", "Load5", "Load15",
	"Processes", "Threads",
	"ProcessesRunning", "ProcessesBlocked",
	"ClonePerSec", "ContextSwitchPerSec"}
View Source
var DefaultVmFields = []string{"PageIn", "PageOut",
	"SwapIn", "SwapOut",
	"PageScanKswapd", "PageScanDirect",
	"PageStealKswapd", "PageStealDirect", "OOMKill"}
View Source
var FiledToCgroupFile = map[string]store.CgroupFile{
	"Anon":                        store.MemoryStatFile,
	"File":                        store.MemoryStatFile,
	"KernelStack":                 store.MemoryStatFile,
	"Slab":                        store.MemoryStatFile,
	"Sock":                        store.MemoryStatFile,
	"Shmem":                       store.MemoryStatFile,
	"Zswap":                       store.MemoryStatFile,
	"Zswapped":                    store.MemoryStatFile,
	"FileMapped":                  store.MemoryStatFile,
	"FileDirty":                   store.MemoryStatFile,
	"FileWriteback":               store.MemoryStatFile,
	"AnonThp":                     store.MemoryStatFile,
	"InactiveAnon":                store.MemoryStatFile,
	"ActiveAnon":                  store.MemoryStatFile,
	"InactiveFile":                store.MemoryStatFile,
	"ActiveFile":                  store.MemoryStatFile,
	"Unevictable":                 store.MemoryStatFile,
	"SlabReclaimable":             store.MemoryStatFile,
	"SlabUnreclaimable":           store.MemoryStatFile,
	"PgfaultPerSec":               store.MemoryStatFile,
	"PgmajfaultPerSec":            store.MemoryStatFile,
	"WorkingsetRefaultPerSec":     store.MemoryStatFile,
	"WorkingsetActivatePerSec":    store.MemoryStatFile,
	"WorkingsetNodereclaimPerSec": store.MemoryStatFile,
	"PgrefillPerSec":              store.MemoryStatFile,
	"PgscanPerSec":                store.MemoryStatFile,
	"PgstealPerSec":               store.MemoryStatFile,
	"PgactivatePerSec":            store.MemoryStatFile,
	"PgdeactivatePerSec":          store.MemoryStatFile,
	"PglazyfreePerSec":            store.MemoryStatFile,
	"PglazyfreedPerSec":           store.MemoryStatFile,
	"ZswpInPerSec":                store.MemoryStatFile,
	"ZswpOutPerSec":               store.MemoryStatFile,
	"ThpFaultAllocPerSec":         store.MemoryStatFile,
	"ThpCollapseAllocPerSec":      store.MemoryStatFile,
	"CpuSetCpus":                  store.CpuSetCpusFile,
	"CpuSetCpusEffective":         store.CpuSetCpusEffectiveFile,
	"CpuSetMems":                  store.CpuSetMemsFileFile,
	"CpuSetMemsEffective":         store.CpuSetMemsEffectiveFile,
	"CpuWeight":                   store.CpuWeightFile,
	"CpuMax":                      store.CpuMaxFile,
	"MemoryCurrent":               store.MemoryCurrentFile,
	"MemoryLow":                   store.MemoryLowFile,
	"MemoryHigh":                  store.MemoryHighFile,
	"MemoryMin":                   store.MemoryMinFile,
	"MemoryMax":                   store.MemoryMaxFile,
	"MemoryPeak":                  store.MemoryPeakFile,
	"SwapCurrent":                 store.MemorySwapCurrentFile,
	"SwapMax":                     store.MemorySwapMaxFile,
	"ZswapCurrent":                store.MemoryZswapCurrentFile,
	"ZswapMax":                    store.MemoryZswapMaxFile,
	"EventLow":                    store.MemoryEventsFile,
	"EventHigh":                   store.MemoryEventsFile,
	"EventMax":                    store.MemoryEventsFile,
	"EventOom":                    store.MemoryEventsFile,
	"EventOomKill":                store.MemoryEventsFile,
	"RbytePerSec":                 store.IoStatFile,
	"WbytePerSec":                 store.IoStatFile,
	"RioPerSec":                   store.IoStatFile,
	"WioPerSec":                   store.IoStatFile,
	"DbytePerSec":                 store.IoStatFile,
	"DioPerSec":                   store.IoStatFile,
	"CPUSomePressure":             store.CpuPressureFile,
	"CPUFullPressure":             store.CpuPressureFile,
	"MemorySomePressure":          store.MemoryPressureFile,
	"MemoryFullPressure":          store.MemoryPressureFile,
	"IOSomePressure":              store.IoPressureFile,
	"IOFullPressure":              store.IoPressureFile,
}

Functions

func PercentWithInterval added in v0.1.5

func PercentWithInterval[T uint64 | int | int64 | float64](curr, prev T, interval int64) float64

func SubWithInterval added in v0.0.3

func SubWithInterval[T uint64 | int | int64 | float64](curr, prev, interval T) float64

Types

type CPU

type CPU struct {
	Index     string
	User      float64
	Nice      float64
	System    float64
	Idle      float64
	Iowait    float64
	IRQ       float64
	SoftIRQ   float64
	Steal     float64
	Guest     float64
	GuestNice float64
}

func (*CPU) DefaultConfig added in v0.0.8

func (c *CPU) DefaultConfig(field string) Field

func (*CPU) DefaultOMConfig added in v0.1.1

func (c *CPU) DefaultOMConfig(field string) OpenMetricField

func (*CPU) GetRenderValue

func (c *CPU) GetRenderValue(field string, opt FieldOpt) string

type CPUSlice

type CPUSlice []CPU

func (*CPUSlice) Collect

func (cpus *CPUSlice) Collect(prev, curr *store.Sample)

type Cgroup added in v0.1.5

type Cgroup struct {
	Path        string
	Name        string
	Level       int
	Inode       uint64
	IsExpand    bool
	Child       map[string]*Cgroup
	IsNotExist  map[store.CgroupFile]struct{}
	Controllers string
	store.CgoupStat
	UsagePercent      float64
	UserPercent       float64
	SystemPercent     float64
	NrPeriodsPerSec   float64
	NrThrottledPerSec float64
	ThrottledPercent  float64
	NrBurstsPerSec    float64
	BurstPercent      float64
	// from memory.stat
	Anon                        uint64
	File                        uint64
	KernelStack                 uint64
	Slab                        uint64
	Sock                        uint64
	Shmem                       uint64
	Zswap                       uint64
	Zswapped                    uint64
	FileMapped                  uint64
	FileDirty                   uint64
	FileWriteback               uint64
	AnonThp                     uint64
	InactiveAnon                uint64
	ActiveAnon                  uint64
	InactiveFile                uint64
	ActiveFile                  uint64
	Unevictable                 uint64
	SlabReclaimable             uint64
	SlabUnreclaimable           uint64
	PgfaultPerSec               float64
	PgmajfaultPerSec            float64
	WorkingsetRefaultPerSec     float64
	WorkingsetActivatePerSec    float64
	WorkingsetNodereclaimPerSec float64
	PgrefillPerSec              float64
	PgscanPerSec                float64
	PgstealPerSec               float64
	PgactivatePerSec            float64
	PgdeactivatePerSec          float64
	PglazyfreePerSec            float64
	PglazyfreedPerSec           float64
	ZswpInPerSec                float64
	ZswpOutPerSec               float64
	ThpFaultAllocPerSec         float64
	ThpCollapseAllocPerSec      float64
	CpuSetCpus                  string
	CpuSetCpusEffective         string
	CpuSetMems                  string
	CpuSetMemsEffective         string
	CpuWeight                   uint64
	CpuMax                      string
	MemoryCurrent               uint64
	MemoryLow                   uint64
	MemoryHigh                  uint64
	MemoryMin                   uint64
	MemoryMax                   uint64
	MemoryPeak                  uint64
	SwapCurrent                 uint64
	SwapMax                     uint64
	ZswapCurrent                uint64
	ZswapMax                    uint64
	// memory event
	EventLow     uint64
	EventHigh    uint64
	EventMax     uint64
	EventOom     uint64
	EventOomKill uint64
	// io.stat
	RbytePerSec float64
	WbytePerSec float64
	RioPerSec   float64
	WioPerSec   float64
	DbytePerSec float64
	DioPerSec   float64
	// pressure file
	CPUSomePressure    float64
	CPUFullPressure    float64
	MemorySomePressure float64
	MemoryFullPressure float64
	IOSomePressure     float64
	IOFullPressure     float64
}

func (*Cgroup) Collect added in v0.1.5

func (c *Cgroup) Collect(prev, curr *store.CgroupSample, interval int64)

func (*Cgroup) DefaultConfig added in v0.1.5

func (c *Cgroup) DefaultConfig(field string) Field

func (*Cgroup) DefaultOMConfig added in v0.1.5

func (c *Cgroup) DefaultOMConfig(field string) OpenMetricField

func (*Cgroup) GetChildCgroupByNames added in v0.1.5

func (c *Cgroup) GetChildCgroupByNames(names []string) *Cgroup

func (*Cgroup) GetRenderValue added in v0.1.5

func (c *Cgroup) GetRenderValue(field string, opt FieldOpt) string

func (*Cgroup) Iterate added in v0.1.5

func (c *Cgroup) Iterate(searchprogram *vm.Program, sortField string, descOrder bool) []*Cgroup

type Disk

type Disk struct {
	DeviceName             string
	ReadIOs                uint64
	ReadMerges             uint64
	ReadSectors            uint64
	ReadTicks              uint64
	WriteIOs               uint64
	WriteMerges            uint64
	WriteSectors           uint64
	WriteTicks             uint64
	IOsInProgress          uint64
	IOsTotalTicks          uint64
	WeightedIOTicks        uint64
	DiscardIOs             uint64
	DiscardMerges          uint64
	DiscardSectors         uint64
	DiscardTicks           uint64
	FlushRequestsCompleted uint64
	TimeSpentFlushing      uint64
	ReadPerSec             float64
	WritePerSec            float64
	DiscardPerSec          float64
	ReadBytePerSec         float64
	WriteBytePerSec        float64
	DiscardBytePerSec      float64
	ReadAvgIOSize          float64
	WriteAvgIOSize         float64
	DiscardAvgIOSize       float64
	AvgIOSize              float64
	ReadAvgWait            float64
	WriteAvgWait           float64
	DiscardAvgWait         float64
	AvgIOWait              float64
	AvgQueueLength         float64
	AvgIOTime              float64
	Util                   float64
}

func (*Disk) DefaultConfig added in v0.0.8

func (d *Disk) DefaultConfig(field string) Field

func (*Disk) DefaultOMConfig added in v0.1.1

func (d *Disk) DefaultOMConfig(field string) OpenMetricField

func (*Disk) GetRenderValue

func (d *Disk) GetRenderValue(field string, opt FieldOpt) string

type DiskMap added in v0.0.2

type DiskMap map[string]Disk

func (DiskMap) Collect added in v0.0.2

func (diskMap DiskMap) Collect(prev, curr *store.Sample)

func (DiskMap) GetKeys added in v0.0.7

func (diskMap DiskMap) GetKeys() []string

type DumpOption added in v0.0.2

type DumpOption struct {
	Begin           int64
	End             int64
	Module          string
	Output          *os.File
	Format          string
	Fields          []string
	FilterText      string
	FilterProgram   *vm.Program
	SortField       string
	DescendingOrder bool
	Top             int
	DisableTitle    bool
	RepeatTitle     int
	RawData         bool
}

type Field added in v0.0.2

type Field struct {
	Name      string
	Format    Format
	Precision int
	Suffix    string
	Width     int
	FixWidth  bool
}

func (*Field) ApplyOpt added in v0.0.8

func (f *Field) ApplyOpt(opt FieldOpt)

func (Field) Render added in v0.0.2

func (f Field) Render(value any) string

func (Field) SetFixWidth added in v0.0.8

func (f Field) SetFixWidth() Field

func (Field) SetRawData added in v0.0.8

func (f Field) SetRawData() Field

type FieldOpt added in v0.0.8

type FieldOpt struct {
	FixWidth bool
	Raw      bool
}

type Format added in v0.0.2

type Format int
const (
	Raw Format = iota
	HumanReadableSize
)

type MEM

type MEM struct {
	MemTotal          uint64
	MemFree           uint64
	MemAvailable      uint64
	Buffers           uint64
	Cached            uint64
	SwapCached        uint64
	Active            uint64
	Inactive          uint64
	ActiveAnon        uint64
	InactiveAnon      uint64
	ActiveFile        uint64
	InactiveFile      uint64
	Unevictable       uint64
	Mlocked           uint64
	SwapTotal         uint64
	SwapFree          uint64
	Dirty             uint64
	Writeback         uint64
	AnonPages         uint64
	Mapped            uint64
	Shmem             uint64
	Slab              uint64
	SReclaimable      uint64
	SUnreclaim        uint64
	KernelStack       uint64
	PageTables        uint64
	NFSUnstable       uint64
	Bounce            uint64
	WritebackTmp      uint64
	CommitLimit       uint64
	CommittedAS       uint64
	VmallocTotal      uint64
	VmallocUsed       uint64
	VmallocChunk      uint64
	HardwareCorrupted uint64
	AnonHugePages     uint64
	ShmemHugePages    uint64
	ShmemPmdMapped    uint64
	CmaTotal          uint64
	CmaFree           uint64
	HugePagesTotal    uint64
	HugePagesFree     uint64
	HugePagesRsvd     uint64
	HugePagesSurp     uint64
	Hugepagesize      uint64
	DirectMap4k       uint64
	DirectMap2M       uint64
	DirectMap1G       uint64
}

func (*MEM) Collect

func (m *MEM) Collect(prev, curr *store.Sample)

func (*MEM) DefaultConfig added in v0.0.8

func (m *MEM) DefaultConfig(field string) Field

func (*MEM) DefaultOMConfig added in v0.1.1

func (m *MEM) DefaultOMConfig(field string) OpenMetricField

func (*MEM) GetRenderValue

func (m *MEM) GetRenderValue(field string, opt FieldOpt) string

type MetricType added in v0.0.8

type MetricType int
const (
	Gauge MetricType = iota
	Counter
)

type Model added in v0.0.2

type Model struct {
	Mode  string
	Store store.Store

	Prev store.Sample
	Curr store.Sample
	Sys  System
	CPUs CPUSlice
	MEM
	Vm
	Disks DiskMap
	Nets  NetDevMap
	NetStat
	NetProtocols NetProtocolMap
	Softnets     SoftnetSlice
	Processes    ProcessMap
	Cgroup
	// contains filtered or unexported fields
}

func NewSysModel

func NewSysModel(s *store.LocalStore, log *slog.Logger) (*Model, error)

func (*Model) CollectField added in v0.0.2

func (s *Model) CollectField()

func (*Model) CollectLiveSample added in v0.0.2

func (s *Model) CollectLiveSample(exit *store.ExitProcess) error

func (*Model) CollectNext added in v0.0.2

func (s *Model) CollectNext() error

func (*Model) CollectPrev added in v0.0.2

func (s *Model) CollectPrev() error

func (*Model) CollectSampleByTime added in v0.0.2

func (s *Model) CollectSampleByTime(timeStamp int64) error

func (*Model) Dump added in v0.0.2

func (s *Model) Dump(opt DumpOption) error

type NetDev added in v0.0.2

type NetDev struct {
	Name           string
	RxBytes        uint64
	RxPackets      uint64
	RxErrors       uint64
	RxDropped      uint64
	RxFIFO         uint64
	RxFrame        uint64
	RxCompressed   uint64
	RxMulticast    uint64
	TxBytes        uint64
	TxPackets      uint64
	TxErrors       uint64
	TxDropped      uint64
	TxFIFO         uint64
	TxCollisions   uint64
	TxCarrier      uint64
	TxCompressed   uint64
	RxBytePerSec   float64
	RxPacketPerSec float64
	TxBytePerSec   float64
	TxPacketPerSec float64
}

func (*NetDev) DefaultConfig added in v0.0.8

func (n *NetDev) DefaultConfig(field string) Field

func (*NetDev) DefaultOMConfig added in v0.1.1

func (n *NetDev) DefaultOMConfig(field string) OpenMetricField

func (*NetDev) GetRenderValue added in v0.0.2

func (n *NetDev) GetRenderValue(field string, opt FieldOpt) string

type NetDevMap added in v0.0.2

type NetDevMap map[string]NetDev

func (NetDevMap) Collect added in v0.0.2

func (netMap NetDevMap) Collect(prev, curr *store.Sample)

func (NetDevMap) GetKeys added in v0.0.5

func (netMap NetDevMap) GetKeys() []string

type NetProtocol added in v0.0.2

type NetProtocol struct {
	Name    string
	Sockets int64
	Memory  int64
}

func (*NetProtocol) DefaultConfig added in v0.0.8

func (n *NetProtocol) DefaultConfig(field string) Field

func (*NetProtocol) DefaultOMConfig added in v0.1.1

func (n *NetProtocol) DefaultOMConfig(field string) OpenMetricField

func (*NetProtocol) GetRenderValue added in v0.0.2

func (n *NetProtocol) GetRenderValue(field string, opt FieldOpt) string

type NetProtocolMap added in v0.0.2

type NetProtocolMap map[string]NetProtocol

func (NetProtocolMap) Collect added in v0.0.2

func (netProtocolMap NetProtocolMap) Collect(prev, curr *store.Sample)

type NetStat added in v0.0.2

type NetStat struct {
	IpInReceives      float64
	IpInHdrErrors     float64
	IpInAddrErrors    float64
	IpForwDatagrams   float64
	IpInUnknownProtos float64
	IpInDiscards      float64
	IpInDelivers      float64
	IpOutRequests     float64
	IpOutDiscards     float64
	IpOutNoRoutes     float64
	IpReasmTimeout    float64
	IpReasmReqds      float64
	IpReasmOKs        float64
	IpReasmFails      float64
	IpFragOKs         float64
	IpFragFails       float64
	IpFragCreates     float64

	IcmpInMsgs           float64
	IcmpInErrors         float64
	IcmpInCsumErrors     float64
	IcmpInDestUnreachs   float64
	IcmpInTimeExcds      float64
	IcmpInParmProbs      float64
	IcmpInSrcQuenchs     float64
	IcmpInRedirects      float64
	IcmpInEchos          float64
	IcmpInEchoReps       float64
	IcmpInTimestamps     float64
	IcmpInTimestampReps  float64
	IcmpInAddrMasks      float64
	IcmpInAddrMaskReps   float64
	IcmpOutMsgs          float64
	IcmpOutErrors        float64
	IcmpOutDestUnreachs  float64
	IcmpOutTimeExcds     float64
	IcmpOutParmProbs     float64
	IcmpOutSrcQuenchs    float64
	IcmpOutRedirects     float64
	IcmpOutEchos         float64
	IcmpOutEchoReps      float64
	IcmpOutTimestamps    float64
	IcmpOutTimestampReps float64
	IcmpOutAddrMasks     float64
	IcmpOutAddrMaskReps  float64
	IcmpInType3          float64
	IcmpOutType3         float64

	TcpActiveOpens  float64
	TcpPassiveOpens float64
	TcpAttemptFails float64
	TcpEstabResets  float64
	TcpCurrEstab    float64
	TcpInSegs       float64
	TcpOutSegs      float64
	TcpRetransSegs  float64
	TcpInErrs       float64
	TcpOutRsts      float64
	TcpInCsumErrors float64

	UdpInDatagrams  float64
	UdpNoPorts      float64
	UdpInErrors     float64
	UdpOutDatagrams float64
	UdpRcvbufErrors float64
	UdpSndbufErrors float64
	UdpInCsumErrors float64
	UdpIgnoredMulti float64

	UdpLiteInDatagrams  float64
	UdpLiteNoPorts      float64
	UdpLiteInErrors     float64
	UdpLiteOutDatagrams float64
	UdpLiteRcvbufErrors float64
	UdpLiteSndbufErrors float64
	UdpLiteInCsumErrors float64
	UdpLiteIgnoredMulti float64

	Ip6InReceives       float64
	Ip6InHdrErrors      float64
	Ip6InTooBigErrors   float64
	Ip6InNoRoutes       float64
	Ip6InAddrErrors     float64
	Ip6InUnknownProtos  float64
	Ip6InTruncatedPkts  float64
	Ip6InDiscards       float64
	Ip6InDelivers       float64
	Ip6OutForwDatagrams float64
	Ip6OutRequests      float64
	Ip6OutDiscards      float64
	Ip6OutNoRoutes      float64
	Ip6ReasmTimeout     float64
	Ip6ReasmReqds       float64
	Ip6ReasmOKs         float64
	Ip6ReasmFails       float64
	Ip6FragOKs          float64
	Ip6FragFails        float64
	Ip6FragCreates      float64
	Ip6InMcastPkts      float64
	Ip6OutMcastPkts     float64
	Ip6InOctets         float64
	Ip6OutOctets        float64
	Ip6InMcastOctets    float64
	Ip6OutMcastOctets   float64
	Ip6InBcastOctets    float64
	Ip6OutBcastOctets   float64
	Ip6InNoECTPkts      float64
	Ip6InECT1Pkts       float64
	Ip6InECT0Pkts       float64
	Ip6InCEPkts         float64

	Icmp6InMsgs                    float64
	Icmp6InErrors                  float64
	Icmp6OutMsgs                   float64
	Icmp6OutErrors                 float64
	Icmp6InCsumErrors              float64
	Icmp6InDestUnreachs            float64
	Icmp6InPktTooBigs              float64
	Icmp6InTimeExcds               float64
	Icmp6InParmProblems            float64
	Icmp6InEchos                   float64
	Icmp6InEchoReplies             float64
	Icmp6InGroupMembQueries        float64
	Icmp6InGroupMembResponses      float64
	Icmp6InGroupMembReductions     float64
	Icmp6InRouterSolicits          float64
	Icmp6InRouterAdvertisements    float64
	Icmp6InNeighborSolicits        float64
	Icmp6InNeighborAdvertisements  float64
	Icmp6InRedirects               float64
	Icmp6InMLDv2Reports            float64
	Icmp6OutDestUnreachs           float64
	Icmp6OutPktTooBigs             float64
	Icmp6OutTimeExcds              float64
	Icmp6OutParmProblems           float64
	Icmp6OutEchos                  float64
	Icmp6OutEchoReplies            float64
	Icmp6OutGroupMembQueries       float64
	Icmp6OutGroupMembResponses     float64
	Icmp6OutGroupMembReductions    float64
	Icmp6OutRouterSolicits         float64
	Icmp6OutRouterAdvertisements   float64
	Icmp6OutNeighborSolicits       float64
	Icmp6OutNeighborAdvertisements float64
	Icmp6OutRedirects              float64
	Icmp6OutMLDv2Reports           float64
	Icmp6InType1                   float64
	Icmp6InType134                 float64
	Icmp6InType135                 float64
	Icmp6InType136                 float64
	Icmp6InType143                 float64
	Icmp6OutType133                float64
	Icmp6OutType135                float64
	Icmp6OutType136                float64
	Icmp6OutType143                float64

	Udp6InDatagrams  float64
	Udp6NoPorts      float64
	Udp6InErrors     float64
	Udp6OutDatagrams float64
	Udp6RcvbufErrors float64
	Udp6SndbufErrors float64
	Udp6InCsumErrors float64
	Udp6IgnoredMulti float64

	UdpLite6InDatagrams  float64
	UdpLite6NoPorts      float64
	UdpLite6InErrors     float64
	UdpLite6OutDatagrams float64
	UdpLite6RcvbufErrors float64
	UdpLite6SndbufErrors float64
	UdpLite6InCsumErrors float64

	TcpExtSyncookiesSent            float64
	TcpExtSyncookiesRecv            float64
	TcpExtSyncookiesFailed          float64
	TcpExtEmbryonicRsts             float64
	TcpExtPruneCalled               float64
	TcpExtRcvPruned                 float64
	TcpExtOfoPruned                 float64
	TcpExtOutOfWindowIcmps          float64
	TcpExtLockDroppedIcmps          float64
	TcpExtArpFilter                 float64
	TcpExtTW                        float64
	TcpExtTWRecycled                float64
	TcpExtTWKilled                  float64
	TcpExtPAWSActive                float64
	TcpExtPAWSEstab                 float64
	TcpExtDelayedACKs               float64
	TcpExtDelayedACKLocked          float64
	TcpExtDelayedACKLost            float64
	TcpExtListenOverflows           float64
	TcpExtListenDrops               float64
	TcpExtTCPHPHits                 float64
	TcpExtTCPPureAcks               float64
	TcpExtTCPHPAcks                 float64
	TcpExtTCPRenoRecovery           float64
	TcpExtTCPSackRecovery           float64
	TcpExtTCPSACKReneging           float64
	TcpExtTCPSACKReorder            float64
	TcpExtTCPRenoReorder            float64
	TcpExtTCPTSReorder              float64
	TcpExtTCPFullUndo               float64
	TcpExtTCPPartialUndo            float64
	TcpExtTCPDSACKUndo              float64
	TcpExtTCPLossUndo               float64
	TcpExtTCPLostRetransmit         float64
	TcpExtTCPRenoFailures           float64
	TcpExtTCPSackFailures           float64
	TcpExtTCPLossFailures           float64
	TcpExtTCPFastRetrans            float64
	TcpExtTCPSlowStartRetrans       float64
	TcpExtTCPTimeouts               float64
	TcpExtTCPLossProbes             float64
	TcpExtTCPLossProbeRecovery      float64
	TcpExtTCPRenoRecoveryFail       float64
	TcpExtTCPSackRecoveryFail       float64
	TcpExtTCPRcvCollapsed           float64
	TcpExtTCPDSACKOldSent           float64
	TcpExtTCPDSACKOfoSent           float64
	TcpExtTCPDSACKRecv              float64
	TcpExtTCPDSACKOfoRecv           float64
	TcpExtTCPAbortOnData            float64
	TcpExtTCPAbortOnClose           float64
	TcpExtTCPAbortOnMemory          float64
	TcpExtTCPAbortOnTimeout         float64
	TcpExtTCPAbortOnLinger          float64
	TcpExtTCPAbortFailed            float64
	TcpExtTCPMemoryPressures        float64
	TcpExtTCPMemoryPressuresChrono  float64
	TcpExtTCPSACKDiscard            float64
	TcpExtTCPDSACKIgnoredOld        float64
	TcpExtTCPDSACKIgnoredNoUndo     float64
	TcpExtTCPSpuriousRTOs           float64
	TcpExtTCPMD5NotFound            float64
	TcpExtTCPMD5Unexpected          float64
	TcpExtTCPMD5Failure             float64
	TcpExtTCPSackShifted            float64
	TcpExtTCPSackMerged             float64
	TcpExtTCPSackShiftFallback      float64
	TcpExtTCPBacklogDrop            float64
	TcpExtPFMemallocDrop            float64
	TcpExtTCPMinTTLDrop             float64
	TcpExtTCPDeferAcceptDrop        float64
	TcpExtIPReversePathFilter       float64
	TcpExtTCPTimeWaitOverflow       float64
	TcpExtTCPReqQFullDoCookies      float64
	TcpExtTCPReqQFullDrop           float64
	TcpExtTCPRetransFail            float64
	TcpExtTCPRcvCoalesce            float64
	TcpExtTCPRcvQDrop               float64
	TcpExtTCPOFOQueue               float64
	TcpExtTCPOFODrop                float64
	TcpExtTCPOFOMerge               float64
	TcpExtTCPChallengeACK           float64
	TcpExtTCPSYNChallenge           float64
	TcpExtTCPFastOpenActive         float64
	TcpExtTCPFastOpenActiveFail     float64
	TcpExtTCPFastOpenPassive        float64
	TcpExtTCPFastOpenPassiveFail    float64
	TcpExtTCPFastOpenListenOverflow float64
	TcpExtTCPFastOpenCookieReqd     float64
	TcpExtTCPFastOpenBlackhole      float64
	TcpExtTCPSpuriousRtxHostQueues  float64
	TcpExtBusyPollRxPackets         float64
	TcpExtTCPAutoCorking            float64
	TcpExtTCPFromZeroWindowAdv      float64
	TcpExtTCPToZeroWindowAdv        float64
	TcpExtTCPWantZeroWindowAdv      float64
	TcpExtTCPSynRetrans             float64
	TcpExtTCPOrigDataSent           float64
	TcpExtTCPHystartTrainDetect     float64
	TcpExtTCPHystartTrainCwnd       float64
	TcpExtTCPHystartDelayDetect     float64
	TcpExtTCPHystartDelayCwnd       float64
	TcpExtTCPACKSkippedSynRecv      float64
	TcpExtTCPACKSkippedPAWS         float64
	TcpExtTCPACKSkippedSeq          float64
	TcpExtTCPACKSkippedFinWait2     float64
	TcpExtTCPACKSkippedTimeWait     float64
	TcpExtTCPACKSkippedChallenge    float64
	TcpExtTCPWinProbe               float64
	TcpExtTCPKeepAlive              float64
	TcpExtTCPMTUPFail               float64
	TcpExtTCPMTUPSuccess            float64
	TcpExtTCPWqueueTooBig           float64

	IpExtInNoRoutes      float64
	IpExtInTruncatedPkts float64
	IpExtInMcastPkts     float64
	IpExtOutMcastPkts    float64
	IpExtInBcastPkts     float64
	IpExtOutBcastPkts    float64
	IpExtInOctets        float64
	IpExtOutOctets       float64
	IpExtInMcastOctets   float64
	IpExtOutMcastOctets  float64
	IpExtInBcastOctets   float64
	IpExtOutBcastOctets  float64
	IpExtInCsumErrors    float64
	IpExtInNoECTPkts     float64
	IpExtInECT1Pkts      float64
	IpExtInECT0Pkts      float64
	IpExtInCEPkts        float64
	IpExtReasmOverlaps   float64
}

func (*NetStat) Collect added in v0.0.2

func (netStat *NetStat) Collect(prev, curr *store.Sample)

func (*NetStat) DefaultConfig added in v0.0.8

func (n *NetStat) DefaultConfig(field string) Field

func (*NetStat) DefaultOMConfig added in v0.1.1

func (n *NetStat) DefaultOMConfig(field string) OpenMetricField

func (*NetStat) GetRenderValue added in v0.0.2

func (n *NetStat) GetRenderValue(field string, opt FieldOpt) string

type OpenMetricField added in v0.0.8

type OpenMetricField struct {
	Name   string
	Typ    MetricType
	Unit   string
	Help   string
	Labels []string
}

type PCPU

type PCPU struct {
	User     float64
	System   float64
	Priority int
	Nice     int
	CPU      float64
}

func (*PCPU) DefaultConfig added in v0.0.8

func (c *PCPU) DefaultConfig(field string) Field

func (*PCPU) DefaultOMConfig added in v0.1.1

func (c *PCPU) DefaultOMConfig(field string) OpenMetricField

func (*PCPU) GetRenderValue

func (c *PCPU) GetRenderValue(field string, opt FieldOpt) string

type PIO

type PIO struct {
	RChar                    uint64
	WChar                    uint64
	ReadCharPerSec           float64
	WriteCharPerSec          float64
	SyscR                    uint64
	SyscW                    uint64
	SyscRPerSec              float64
	SyscWPerSec              float64
	ReadBytes                uint64
	WriteBytes               uint64
	CancelledWriteBytes      int64
	ReadBytePerSec           float64
	WriteBytePerSec          float64
	CancelledWriteBytePerSec float64
	Disk                     float64
}

func (*PIO) DefaultConfig added in v0.0.8

func (i *PIO) DefaultConfig(field string) Field

func (*PIO) DefaultOMConfig added in v0.1.1

func (i *PIO) DefaultOMConfig(field string) OpenMetricField

func (*PIO) GetRenderValue

func (i *PIO) GetRenderValue(field string, opt FieldOpt) string

type PMEM

type PMEM struct {
	MinFlt uint
	MajFlt uint
	VSize  uint
	RSS    int
	Mem    float64
}

func (*PMEM) DefaultConfig added in v0.0.8

func (m *PMEM) DefaultConfig(field string) Field

func (*PMEM) DefaultOMConfig added in v0.1.1

func (m *PMEM) DefaultOMConfig(field string) OpenMetricField

func (*PMEM) GetRenderValue

func (m *PMEM) GetRenderValue(field string, opt FieldOpt) string

type Process

type Process struct {
	Pid        int
	Comm       string
	State      string
	Ppid       int
	NumThreads int
	StartTime  uint64
	EndTime    uint64
	ExitCode   uint32
	OnCPU      uint
	CmdLine    string
	Cgroup     string
	PCPU
	PMEM
	PIO
}

func (*Process) DefaultConfig added in v0.0.8

func (p *Process) DefaultConfig(field string) Field

func (*Process) DefaultOMConfig added in v0.1.1

func (p *Process) DefaultOMConfig(field string) OpenMetricField

func (*Process) GetRenderValue

func (p *Process) GetRenderValue(field string, opt FieldOpt) string

type ProcessMap added in v0.0.2

type ProcessMap map[int]Process

func (ProcessMap) Collect added in v0.0.2

func (processMap ProcessMap) Collect(prev, curr *store.Sample) (processes, threads uint64)

func (ProcessMap) Iterate added in v0.1.3

func (processMap ProcessMap) Iterate(searchprogram *vm.Program, sortField string, descOrder bool) []Process

type Render added in v0.0.8

type Render interface {
	DefaultConfig(field string) Field
	DefaultOMConfig(field string) OpenMetricField
	GetRenderValue(field string, opt FieldOpt) string
}

type Softnet added in v0.0.2

type Softnet struct {
	CPU               uint32
	Processed         uint32
	Dropped           uint32
	TimeSqueezed      uint32
	CPUCollision      uint32
	ReceivedRps       uint32
	FlowLimitCount    uint32
	SoftnetBacklogLen uint32
}

func (*Softnet) DefaultConfig added in v0.0.8

func (softnet *Softnet) DefaultConfig(field string) Field

func (*Softnet) DefaultOMConfig added in v0.1.1

func (softnet *Softnet) DefaultOMConfig(field string) OpenMetricField

func (*Softnet) GetRenderValue added in v0.0.2

func (softnet *Softnet) GetRenderValue(field string, opt FieldOpt) string

type SoftnetSlice added in v0.0.2

type SoftnetSlice []Softnet

func (*SoftnetSlice) Collect added in v0.0.2

func (softnets *SoftnetSlice) Collect(prev, curr *store.Sample)

type System

type System struct {
	Load1               float64
	Load5               float64
	Load15              float64
	Processes           uint64
	Threads             uint64
	ProcessesRunning    uint64
	ProcessesBlocked    uint64
	ClonePerSec         float64
	ContextSwitchPerSec float64
}

func (*System) Collect added in v0.0.2

func (sys *System) Collect(prev, curr *store.Sample)

func (*System) DefaultConfig added in v0.0.8

func (sys *System) DefaultConfig(field string) Field

func (*System) DefaultOMConfig added in v0.1.1

func (sys *System) DefaultOMConfig(field string) OpenMetricField

func (*System) GetRenderValue added in v0.0.2

func (sys *System) GetRenderValue(field string, opt FieldOpt) string

type Vm added in v0.0.2

type Vm struct {
	PageIn          uint64
	PageOut         uint64
	SwapIn          uint64
	SwapOut         uint64
	PageScanKswapd  uint64
	PageScanDirect  uint64
	PageStealKswapd uint64
	PageStealDirect uint64
	OOMKill         uint64
}

func (*Vm) Collect added in v0.0.2

func (v *Vm) Collect(prev, curr *store.Sample)

func (*Vm) DefaultConfig added in v0.0.8

func (v *Vm) DefaultConfig(field string) Field

func (*Vm) DefaultOMConfig added in v0.1.1

func (v *Vm) DefaultOMConfig(field string) OpenMetricField

func (*Vm) GetRenderValue added in v0.0.2

func (v *Vm) GetRenderValue(field string, opt FieldOpt) string

Jump to

Keyboard shortcuts

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