Documentation
¶
Overview ¶
Package hoststat reads host-level CPU, memory and disk usage from /proc and the filesystem. It has no dependencies on the rest of the codebase so both the server's resource service and the remote agent collector can use it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader samples host CPU and memory at 1s intervals via /proc. It runs its own goroutine, independent of any container collector.
func NewReader ¶
func NewReader() *Reader
NewReader creates a reader and takes an initial CPU sample.
func (*Reader) CPUPercent ¶
CPUPercent returns the latest host CPU usage percentage (0-100).
Click to show internal directories.
Click to hide internal directories.