Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefault ¶
func SetDefault(sm *StatsMonitor)
SetDefault set the default StatsMonitor instance used by the package-level functions.
Types ¶
type StatsMonitor ¶
type StatsMonitor struct { Logger log.Logger Interval time.Duration // stats collect interval DiskFree int64 // disk free threshold (average by count) DiskCount int // disk stats collect count CPUUsage float64 // cpu usage threshold (average by count) CPUCount int // cpu stats collect count MemUsage float64 // memory usage threshold (average by count) MemCount int // mem stats collect count // contains filtered or unexported fields }
func Default ¶
func Default() *StatsMonitor
Default returns the default StatsMonitor instance used by the package-level functions.
func NewStatsMonitor ¶
func NewStatsMonitor() *StatsMonitor
func (*StatsMonitor) Collect ¶
func (sm *StatsMonitor) Collect()
func (*StatsMonitor) LastCPUStats ¶
func (sm *StatsMonitor) LastCPUStats() cpu.CPUStats
LastCPUStats get the last cpu stats
func (*StatsMonitor) LastCPUUsage ¶
func (sm *StatsMonitor) LastCPUUsage() cpu.CPUUsage
LastCPUUsage get the last cpu usage
func (*StatsMonitor) Monitoring ¶
func (sm *StatsMonitor) Monitoring() bool
Monitoring return the monitor is running or not
Click to show internal directories.
Click to hide internal directories.