Skip to main content

oomtop_core/
lib.rs

1//! # oomtop-core
2//!
3//! Pure core of oomtop (SPEC §6): the data model, units, `Measured<T>`, attribution matching, headroom,
4//! `can_fit`, model-load estimates, OOM forecast, throttle, `why`, redaction, query understanding, ranking,
5//! headline generation and situation modes. **No I/O** — everything is a pure function over snapshots,
6//! so it is fully unit-testable with fixtures and golden files.
7//!
8//! Module ↔ spec map:
9//! | module | spec |
10//! |---|---|
11//! | [`model`] | SPEC §5 (FROZEN) |
12//! | [`measured`], [`units`] | SPEC §5, UX §12.5 |
13//! | [`headroom`] | SPEC §8.1 |
14//! | [`can_fit`] | SPEC §8.2 |
15//! | [`model_estimate`] | SPEC §8.2 (GGUF header parser) |
16//! | [`history`], [`forecast`] | SPEC §6.2, §8.3 |
17//! | [`attribution`] | SPEC §7 |
18//! | [`idle`] | SPEC §7 (idle/orphan) |
19//! | [`staleness`] | SPEC §5 (time fields), §7 (staleness, cohorts, duplicates) |
20//! | [`net`] | SPEC §5 (network), §13 (ports, links, exposure) |
21//! | [`pivot`] | SPEC §7 (pivot grouping) |
22//! | [`limits`], [`cluster`], [`namespaces`] | SPEC §8.3 (per-limit forecast), §11 (containers, clusters, VM slack, namespaces) |
23//! | [`fingerprint`] | UX §4 |
24//! | [`throttle`], [`why`] | SPEC §9 |
25//! | [`redact`] | SPEC §13 |
26//! | [`actions`] | SPEC §7, §13 |
27//! | [`query`] | UX §5.2 |
28//! | [`ranking`] | UX §5.4 |
29//! | [`headline`] | UX §9 |
30//! | [`machine`] | UX §2 (machine display name) |
31//! | [`modes`] | UX §3 |
32//! | [`provider`] | frontend contracts (docs/CONTRACTS.md) |
33
34pub mod actions;
35pub mod attribution;
36pub mod can_fit;
37pub mod cluster;
38pub mod fingerprint;
39pub mod forecast;
40pub mod headline;
41pub mod headroom;
42pub mod history;
43pub mod idle;
44pub mod limits;
45pub mod machine;
46pub mod measured;
47pub mod model;
48pub mod model_estimate;
49pub mod modes;
50pub mod namespaces;
51pub mod net;
52pub mod pivot;
53pub mod provider;
54pub mod query;
55pub mod ranking;
56pub mod redact;
57pub mod staleness;
58pub mod throttle;
59pub mod units;
60pub mod why;
61
62pub use model::*;
63
64/// Crate version (also the `oomtop --version`).
65pub const VERSION: &str = env!("CARGO_PKG_VERSION");