Skip to main content

Module sysmon

Module sysmon 

Source
Expand description

Session-level system-performance sampler (SRD-118).

Enabled per session with sysmon=<categories>: sysmon=all, sysmon=any, or a comma list of category names. all and any differ in exactly one way: all ABORTS when a subsystem is unavailable, any enables what the host supports and NAMES what it skipped. Reads /proc (and statvfs) on a fixed interval (default 5 s, sysmon_interval=<seconds>) and publishes host-side measures as session-scoped gauges plus a live observer callback for display surfaces: measurement of the machine under the workload, not of the workload.

The host is read through nmbrs-host (SRD-118 §9), which holds each category’s counters, parser and arithmetic. This module holds what makes those readings a session’s sampler: the sysmon= setting, what it requires of the session, the sample a window yields, the gauges and the task.

Counters are cumulative, so every rate here is a pairwise delta over the sample window; the published gauge is the latest window’s value and any windowing beyond that belongs to MetricsQL at query time.

Modules§

gauges
The sampler’s gauges (SRD-118 §4): which families each category publishes, and writing a sample to them.

Structs§

SysmonConfig
Sampler configuration, resolved by the runner from session params.
SysmonSample
One completed sample window. A field is Some, or a list is filled, exactly when its category was enabled and had a reading — a disabled category is absent, not zero.

Enums§

Selection
What a sysmon= value asked for: a fixed category set, or “whatever this host supports”.

Constants§

UNSUPPORTED_PLATFORM
What the platform check says when it fails.

Functions§

check_rambw_requirements
The rambw prerequisites, checked BEFORE the session starts so an unsupported host aborts with instructions instead of silently monitoring less than was asked for.
check_requirements
Everything a named category needs of this host, checked before the session starts. sysmon_procs= without the proc category, and sysmon_cgroups= without cgroup, are refused here too: each would otherwise name something nothing watches.
parse_categories
Parse a fixed category list (all or comma names). See parse_selection for the any form.
parse_selection
Parse a sysmon= value: all, any, or a comma list of category names. Unknown names are errors that NAME the valid set — a typo silently monitoring nothing would be the failure mode this surface exists to avoid.
resolve_any
Resolve sysmon=any against THIS host: every category the host supports, plus one human-readable line per category that had to be skipped and why. The /proc-backed categories are always available on Linux; rambw, pressure and cgroup carry real prerequisites.
spawn
Spawn the sampler. check_requirements must have passed first — the runner aborts the session on its Err rather than calling this. Runs until session shutdown; publishes each window to the session gauges and to observer.sysmon_update.