Versions in this module Expand all Collapse all v1 v1.1.1 Oct 16, 2026 v1.1.0 Oct 13, 2026 Changes in this version + const LogStderr + const LogStdout + var ErrMemTotalNotFound = errors.New("memTotal field not found in /proc/meminfo") + var ErrNoCPULine = errors.New("cpu line not found in /proc/stat") + var ErrNoCPUMHzFound = errors.New("no 'cpu MHz' entries found in /proc/cpuinfo") + func GetCPUFreqMHz() (float64, error) + func GetTotalMemoryMB() (uint64, error) + func PersistPosition(lat, lon float64) error + type AnchorEntry struct + Addr netip.AddrPort + Lat float64 + Lon float64 + Name string + func (a AnchorEntry) AnchorPoint() (geo.Point, bool) + type HostPressure struct + CPU uint8 + Disk uint8 + Mem uint8 + type LogLine struct + At time.Time + Stream string + Text string + type LogRing struct + func (r *LogRing) Write(p []byte) (int, error) + type NodeConfig struct + AdvertiseAddress netip.Addr + Anchor bool + Anchors []AnchorEntry + ID uuid.UUID + MemberlistAddress netip.AddrPort + Position *geo.Point + func LoadOrCreateNodeConfig() (config *NodeConfig, err error) + func UpdateNodeConfig(config *NodeConfig) (_ *NodeConfig, err error) + type Sampler struct + func NewSampler() *Sampler + func (s *Sampler) CaptureTrend() + func (s *Sampler) DropWorkload(id uuid.UUID) + func (s *Sampler) LastHost() HostPressure + func (s *Sampler) LastPosition() *geo.Point + func (s *Sampler) LogLines(id uuid.UUID) []LogLine + func (s *Sampler) LogWriter(id uuid.UUID, stream string) io.Writer + func (s *Sampler) RecordPosition(pos geo.Point) + func (s *Sampler) SampleHost() (HostPressure, error) + func (s *Sampler) SampleWorkload(id uuid.UUID, cpuTotal, memUsageBytes, memLimitBytes uint64, now time.Time) WorkloadSample + func (s *Sampler) SetTrackLog(t *TrackLog) + func (s *Sampler) Trail() []trailPoint + func (s *Sampler) Trend(id uuid.UUID) (cpu, mem uint8, n int) + func (s *Sampler) Workloads() map[uuid.UUID]WorkloadSample + type TrackLog struct + func OpenTrackLog() (*TrackLog, error) + func (t *TrackLog) Append(at time.Time, lat, lon float64) error + func (t *TrackLog) Close() error + type WorkloadSample struct + CPUPercent uint8 + MemPercent uint8 + MemUsageMB uint64