Expand description
Stats server, #[derive(Stats)] metrics and monitor loop.
Metrics corresponds to the BPF-side struct mlfq_stats: the type is
defined in src/bpf/intf.h and the volatile instance lives in
src/bpf/main.bpf.c, plus a userspace uptime gauge. Field names match
the BPF struct 1:1. The top stats op reports deltas over the poll
interval.
Structs§
- Metrics
- PerCpu
Metrics - One entry of the web UI’s per-CPU card grid.
- WebMetrics
- Snapshot served by the web UI’s
/api/statsendpoint.
Constants§
- OP_
LAT_ 🔒EDGES_ US - Bucket edges of the op-latency histogram, matching
enum mlfq_op_lat_constsinsrc/bpf/intf.h, in microseconds.
Functions§
- fmt_
op_ 🔒lat - Format one op’s eight bucket counts with their microsecond edges as “low-high=count” pairs. A histogram shorter than eight buckets (the untracked default) formats as “n/a”.
- monitor
- The monitor loop. It periodically polls the stats server and prints a
one-line summary. It runs in its own thread (see
main.rs) and exits on shutdown. - server_
data - The stats server definition. A single
topop reporting interval deltas.