Versions in this module Expand all Collapse all v1 v1.3.0 Aug 14, 2025 v1.2.1 Aug 14, 2025 v1.2.0 Aug 14, 2025 Changes in this version + func FormatBytes(bytes uint64) string + func FormatPercent(percent float64) string + type CPUStats struct + Cores int + IdlePercent float64 + SystemPercent float64 + UsagePercent float64 + UserPercent float64 + type Collector struct + func NewCollector(includeContainers bool, maxHistory int) *Collector + func (c *Collector) CheckAlerts() []ResourceAlert + func (c *Collector) ClearHistory() + func (c *Collector) GetAverages(duration time.Duration) *SystemStats + func (c *Collector) GetCurrent() (*SystemStats, error) + func (c *Collector) GetHistory() []SystemStats + func (c *Collector) GetHistorySince(since time.Time) []SystemStats + func (c *Collector) SetInterval(interval time.Duration) + func (c *Collector) Start() + func (c *Collector) Stop() + type ContainerStats struct + BlockIO string + CPUPercent float64 + ID string + MemLimit uint64 + MemPercent float64 + MemUsage uint64 + Name string + NetIO string + Status string + type DiskStats struct + Free uint64 + Mountpoint string + Total uint64 + Used uint64 + UsedPercent float64 + type LoadStats struct + Load1 float64 + Load15 float64 + Load5 float64 + type MemoryStats struct + Available uint64 + Buffers uint64 + Cached uint64 + Free uint64 + SwapFree uint64 + SwapTotal uint64 + SwapUsed uint64 + Total uint64 + Used uint64 + UsedPercent float64 + type Monitor struct + func NewMonitor(includeContainers bool) *Monitor + func (m *Monitor) GetSystemStats() (*SystemStats, error) + func (m *Monitor) GetTopProcesses(count int, sortBy string) ([]ProcessInfo, error) + func (m *Monitor) StreamStats(ctx context.Context, interval time.Duration, ch chan<- *SystemStats) + type NetworkStats struct + BytesRecv uint64 + BytesSent uint64 + PacketsRecv uint64 + PacketsSent uint64 + type ProcessInfo struct + CPUPercent float64 + Command string + MemoryKB uint64 + Name string + PID int + State string + User string + type ProcessStats struct + Running int + Sleeping int + Stopped int + Total int + Zombie int + type ResourceAlert struct + Message string + Severity string + Threshold float64 + Timestamp time.Time + Type string + Value float64 + type SystemStats struct + CPU CPUStats + Containers []ContainerStats + Disk DiskStats + LoadAverage LoadStats + Memory MemoryStats + Network NetworkStats + Processes ProcessStats + Timestamp time.Time