monitoring

package
v0.0.0-...-1986343 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMonitoringD

func RunMonitoringD(statsCmdGoChan <-chan string)

RunMonitoringD runs the monitoring daemon and continously retrives and calculate system stats.

Types

type SimpleStatsData

type SimpleStatsData struct {
	IdleCPU float32
	IdleMen float32
}

SimpleStatsData stores basic stats infomation (CPU and memory)

func GetStats

func GetStats() SimpleStatsData

GetStats returns the simple stats

type Stats

type Stats struct {

	// stats this process
	ProcUptime        float64 //seconds
	ProcMemUsedPct    float64
	ProcCPUAvg        systemstat.ProcCPUAverage
	LastProcCPUSample systemstat.ProcCPUSample `json:"-"`
	CurProcCPUSample  systemstat.ProcCPUSample `json:"-"`

	// stats for whole system
	LastCPUSample systemstat.CPUSample `json:"-"`
	CurCPUSample  systemstat.CPUSample `json:"-"`
	SysCPUAvg     systemstat.CPUAverage
	SysMemK       systemstat.MemSample
	LoadAverage   systemstat.LoadAvgSample
	SysUptime     systemstat.UptimeSample
	// contains filtered or unexported fields
}

Stats struct stores the stats

func NewStats

func NewStats() *Stats

NewStats creates new stats

func (*Stats) GatherStats

func (s *Stats) GatherStats(percent bool)

GatherStats gathers stats

func (*Stats) SetStats

func (s *Stats) SetStats()

type StatsChannelConfig

type StatsChannelConfig struct {
	// contains filtered or unexported fields
}

StatsChannelConfig structure keeps the channel configuration

Jump to

Keyboard shortcuts

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