1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2024-2026 Jonathan Shook
// SPDX-License-Identifier: Apache-2.0
//! Readings of the host nmbrs runs on (SRD-118 ยง9).
//!
//! The session sampler (`sysmon=`) and the `host` adapter both read
//! the host through this crate, so each subsystem is read and parsed
//! in one place.
//!
//! - [`category`]: the subsystems' names and what each needs of this
//! host.
//! - [`cpu`], [`mem`], [`disk`], [`net`], [`pressure`], [`process`],
//! [`cgroup`]: each subsystem's counters, the parser of its files,
//! and the arithmetic between two readings.
//! - [`snapshot`]: one reading of chosen categories, as named measures.
//! - [`du`]: the disk space a directory takes.
//!
//! The parsers take text, so the arithmetic is tested on fixtures;
//! only the `read_*` functions, the watchers of a process or a control
//! group, and the directory walk touch the filesystem.
/// True when `name` can name a watched process or control group: one
/// or more letters, digits, `_` and `-`. The name becomes a label
/// value.
pub