Documentation
¶
Overview ¶
Package procstat reads live process statistics from the operating system.
The observations are best effort: a zero value means the platform could not answer, never that the process used no memory. Callers that publish a metric must treat zero as "unknown" and say so.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrProcessListUnsupported = errors.New("procstat: this platform cannot enumerate processes")
ErrProcessListUnsupported reports that this build cannot enumerate processes. It is a declared limitation rather than an empty answer: a command that stops processes must not report success because it could not see any.
Functions ¶
func ResidentBytes ¶
ResidentBytes returns the current resident set size of pid in bytes, or 0 when the platform cannot report it.
Types ¶
type Process ¶
Process is one live process, named by the arguments it was started with.
Only processes this user can read are listed. Enumerating another user's arguments needs privileges this tool does not want, and a process it cannot read is one it could not signal either.
func (Process) Command ¶
Command answers the process's argv joined for a report, or its identifier when the platform gave no arguments.
func (Process) Invocation ¶
Invocation reports the executable's base name and its first argument, which is what distinguishes `kivgraph serve` from `kivgraph index`.