Skip to main content

Module usage

Module usage 

Source
Expand description

Resource usage observations for the current process.

This module is a mechanism, not a policy. It reports what each source says, under that source’s own name, and never combines two sources into a third figure. The discrepancies between sources carry information: cgroup memory far above VmRSS means page cache or kernel memory is charged to the replica, which is exactly the case a single fused “memory” number hides. Deciding which source answers “how much memory is this replica using” belongs to the SQL views built on top.

Peaks are observations too. cgroup memory.peak and getrusage’s ru_maxrss are high-water marks the kernel maintains itself, so they carry no sampling error and outlive anything short of the process exiting. Only a source with no kernel-side peak gets one folded here, reported under a distinct metric name so a caller can tell an exact peak from a sampled one.

Modules§

source
Source names, as reported alongside each observation.

Structs§

ProcStatus
Memory usage of the current process, read from /proc/self/status.

Functions§

disk_usage
Return the used bytes of the filesystem containing root.
observations
Return the most recent resource usage observations of this process.

Type Aliases§

MetricKey
Identifies one observation: which reader produced it, and what it measures.