Skip to main content

Module stats

Module stats 

Source
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
PerCpuMetrics
One entry of the web UI’s per-CPU card grid.
WebMetrics
Snapshot served by the web UI’s /api/stats endpoint.

Constants§

OP_LAT_EDGES_US 🔒
Bucket edges of the op-latency histogram, matching enum mlfq_op_lat_consts in src/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 top op reporting interval deltas.