stats

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FDStats

func FDStats() (usedFD int64, maxFD int64, err error)

func TimeLoadPerc

func TimeLoadPerc(ts *signalutils.Timeseries, loadTime time.Duration) (float64, bool)

func ValuesAvg

func ValuesAvg(ts *signalutils.Timeseries, timeSpan time.Duration) (float64, bool)

Types

type CPUStats

type CPUStats struct {
	Total *CPUTimes
	CPU   []*CPUTimes
}

func NewCPUStats

func NewCPUStats(ctx context.Context, timeseriesMaxSpan time.Duration, sampleFreq float64) *CPUStats

func (*CPUStats) CPUCount

func (c *CPUStats) CPUCount() (int, error)

type DiskStats

type DiskStats struct {
	Disks      map[string]*DiskMetrics
	Partitions map[string]*PartitionMetrics
	FD         *FDMetrics
	// contains filtered or unexported fields
}

func NewDiskStats

func NewDiskStats(ctx context.Context, timeseriesSize time.Duration, ioRateLoadDuration time.Duration, sampleFreq float64) *DiskStats

func (*DiskStats) TopByteRate

func (d *DiskStats) TopByteRate(read bool) []*DiskMetrics

func (*DiskStats) TopIOUtil

func (d *DiskStats) TopIOUtil(read bool) []*DiskMetrics

func (*DiskStats) TopOpRate

func (d *DiskStats) TopOpRate(read bool) []*DiskMetrics

type FDMetrics

type FDMetrics struct {
	UsedFD signalutils.Timeseries
	MaxFD  int64
}

type MemStats

func NewMemStats

func NewMemStats(ctx context.Context, timeseriesMaxSpan time.Duration, sampleFreq float64) *MemStats

type NetStats

type NetStats struct {
	NICs map[string]*NICMetrics
	// contains filtered or unexported fields
}

func NewNetStats

func NewNetStats(ctx context.Context, timeseriesSize time.Duration, ioRateLoadDuration time.Duration, sampleFreq float64) *NetStats

func (*NetStats) TopByteRate

func (d *NetStats) TopByteRate(recv bool) []*NICMetrics

func (*NetStats) TopErrorsRate

func (d *NetStats) TopErrorsRate(in bool) []*NICMetrics

func (*NetStats) TopPacketRate

func (d *NetStats) TopPacketRate(recv bool) []*NICMetrics

type PartitionMetrics

type PartitionMetrics struct {
	Path        string
	Fstype      string
	Total       uint64
	Free        signalutils.Timeseries
	InodesTotal uint64
	InodesFree  signalutils.Timeseries
}

type ProcessMetrics

type ProcessMetrics struct {
	Pid                int32
	Name               string
	Cmdline            string
	LastSeen           time.Time
	CPUTimes           *CPUTimes
	Connections        signalutils.Timeseries
	TotalNetIOCounters *NetIOCounters
	NetIOCounters      map[string]*NetIOCounters
	IOCounters         *IOCounters
	MemoryPercent      signalutils.Timeseries
	MemoryTotal        signalutils.Timeseries
	MemorySwap         signalutils.Timeseries
	FD                 signalutils.Timeseries
	OpenFiles          signalutils.Timeseries
}

type ProcessStats

type ProcessStats struct {
	Processes map[int32]*ProcessMetrics
	// contains filtered or unexported fields
}

func NewProcessStats

func NewProcessStats(ctx context.Context, timeseriesMaxSpan time.Duration, ioLoadRateTimeSpan time.Duration, cpuLoadTimeSpan time.Duration, memAvgTimeSpan time.Duration, sampleFreq float64) *ProcessStats

func (*ProcessStats) TopCPUIOWait

func (p *ProcessStats) TopCPUIOWait() []*ProcessMetrics

func (*ProcessStats) TopCPULoad

func (p *ProcessStats) TopCPULoad() []*ProcessMetrics

func (*ProcessStats) TopFD

func (p *ProcessStats) TopFD() []*ProcessMetrics

func (*ProcessStats) TopIOByteRate

func (p *ProcessStats) TopIOByteRate(read bool) []*ProcessMetrics

func (*ProcessStats) TopIOOpRate

func (p *ProcessStats) TopIOOpRate(read bool) []*ProcessMetrics

func (*ProcessStats) TopMemSwap

func (p *ProcessStats) TopMemSwap() []*ProcessMetrics

func (*ProcessStats) TopMemUsed

func (p *ProcessStats) TopMemUsed() []*ProcessMetrics

func (*ProcessStats) TopNetByteRate

func (p *ProcessStats) TopNetByteRate(recv bool) []*ProcessMetrics

func (*ProcessStats) TopNetConnCount

func (p *ProcessStats) TopNetConnCount() []*ProcessMetrics

func (*ProcessStats) TopNetErrRate

func (p *ProcessStats) TopNetErrRate(in bool) []*ProcessMetrics

func (*ProcessStats) TopNetPacketRate

func (p *ProcessStats) TopNetPacketRate(recv bool) []*ProcessMetrics

Jump to

Keyboard shortcuts

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