Help us shape the future of Go! Take the 2026 Go Developer Survey

procstat

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package procstat reads what one process uses of its machine: the daemon's for sys.stats, the app's for autodoc.app.stats (ADR 1792256101 §4.1). It needs nothing beyond the standard library. A size the platform cannot say is 0: Darwin has no current resident size without Mach's task_info, so its RSS is 0 and its PeakRSS is getrusage's.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats struct {
	PID        int
	Started    time.Time // when this process loaded the package: its start, near enough
	RSS        uint64    // resident bytes now (Linux; 0 elsewhere)
	PeakRSS    uint64    // the most resident bytes so far, getrusage's maxrss in bytes
	CPUSeconds float64   // user + system CPU used so far: cumulative, never a rate
	GoMemory   uint64    // what the Go runtime has mapped
	GoHeap     uint64    // live heap objects
	Goroutines int
	CPUs       int
}

Stats is one process's use, read now.

func Read

func Read() Stats

Read is this process's Stats now.

Jump to

Keyboard shortcuts

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