stats

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache holds system metrics updated globally once per second. This avoids O(N) syscall overhead when multiple clients are connected.

func New

func New() *Cache

func (*Cache) GetSnapshot

func (c *Cache) GetSnapshot() Snapshot

func (*Cache) Run

func (c *Cache) Run()

Run starts the background updater. Blocking. Run in a goroutine.

type Snapshot

type Snapshot struct {
	Uptime       time.Duration
	CPULoad      float64
	NumGoroutine int
	MemoryUsage  uint64
}

Snapshots returns a struct friendly for the TUI

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL