sysinfo

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Spawn

func Spawn(ctx context.Context, interval types.Duration) (*process.Process, error)

Spawn a system information process.

The provided context must have a `process.Manager` entry in its user value. See `contextdi` and `process.SetProcessManager`.

Types

type Proc added in v0.4.1

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

func NewProc added in v0.4.1

func NewProc() *Proc

Create a new system information process with default values.

func (*Proc) Action added in v0.4.1

func (sip *Proc) Action(state *process.State)

Function that runs every tick in the sysinfo process.

Simply prints out the Go runtime stats via the process's logger.

type SysInfo

type SysInfo struct {
	sync.Mutex
	// contains filtered or unexported fields
}

System information poller.

func NewSysInfo

func NewSysInfo() *SysInfo

Create a new System Information instance.

func (*SysInfo) Allocated

func (si *SysInfo) Allocated() uint64

Return number of MiB currently allocated.

func (*SysInfo) GC

func (si *SysInfo) GC() uint32

Return the number of collections performed.

func (*SysInfo) GoRoutines

func (si *SysInfo) GoRoutines() int

Return the number of Go routines.

func (*SysInfo) Heap

func (si *SysInfo) Heap() uint64

Return number of MiB used by the heap.

func (*SysInfo) Hostname

func (si *SysInfo) Hostname() string

Return this system's hostname.

func (*SysInfo) RunTime

func (si *SysInfo) RunTime() time.Duration

Return the time running.

func (*SysInfo) System

func (si *SysInfo) System() uint64

Return number of MiB allocated from the system.

func (*SysInfo) UpdateStats

func (si *SysInfo) UpdateStats()

Update runtime statistics.

Jump to

Keyboard shortcuts

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