Versions in this module Expand all Collapse all v1 v1.2.13 Oct 11, 2026 v1.2.12 Oct 11, 2026 Changes in this version type Sampler + func (s *Sampler) Load1Percent() (float64, bool) v1.2.11 Oct 11, 2026 v1.2.10 Oct 11, 2026 v1.2.9 Oct 11, 2026 v1.2.8 Oct 11, 2026 v1.2.7 Oct 11, 2026 v1.2.6 Oct 10, 2026 v1.2.5 Oct 10, 2026 v1.2.4 Oct 10, 2026 v1.2.3 Oct 10, 2026 Changes in this version + const FilesAlarmDefault + const FilesTop + const FilesWarnDefault + const HoldersEvery + const HoldersTimeout + const HowCPU + const HowGiven + const HowLoad1 + const LevelAlarm + const LevelOK + const LevelWarn + const MaxPercent + const RingSize + const TopEvery + func BusyPercent(prev, cur Ticks) (float64, bool) + func FilesBounds(src Source) (warn, alarm int) + func HoldersTimedOut(tool string) error — darwin/amd64, linux/amd64 + func LoadPercent(load1 float64, ncpu int) float64 + func ParseFileNr(s string) (open, limit int, ok bool) — linux/amd64 + func ParseIostat(s string) (float64, bool) — darwin/amd64 + func ParseProcLoadavg(s string) (float64, bool) — linux/amd64 + func ParseTopCPU(s string) (float64, bool) + func ParseVMLoadavg(b []byte) (float64, bool) — darwin/amd64 + type Files struct + Alarm int + At time.Time + Max int + Open int + Top []Holder + TopAt time.Time + TopErr string + Warn int + func MeasureFiles(src Source, prev *Files, now time.Time) *Files + func (f Files) Level() string + func (f Files) TopText() string + type Holder struct + Command string + Open int + PID int + User string + func ParseLsof(s string) []Holder + func ProcHolders(root string, deadline time.Time) ([]Holder, error) + func TopHolders(hs []Holder, n int) []Holder + func (h Holder) String() string + type Ring struct + func (r *Ring) Add(pct float64) + func (r *Ring) Count() uint64 + func (r *Ring) MaxSince(count uint64) (float64, bool) + type Sampler struct + func NewSampler(src Source) *Sampler + func (s *Sampler) Peak(since uint64) (pct float64, total uint64, ok bool) + func (s *Sampler) Run(ctx context.Context) + func (s *Sampler) Step() (float64, bool) + type Source struct + CPUSecond func() (float64, error) + FilesAlarm int + FilesWarn int + Given func() (float64, bool) + Holders func() ([]Holder, error) + Load1 func() (float64, bool) + NCPU int + OpenFiles func() (open, limit int, err error) + ProcStat func() (string, error) + Top func() (string, error) + func Local() Source + type State struct + Files *Files + Ticks *Ticks + TopAt time.Time + TopPct float64 + func Measure(src Source, prev State, now time.Time) (pct float64, how string, next State, ok bool) + type Ticks struct + Busy uint64 + Total uint64 + func ParseProcStat(s string) (Ticks, bool)