Skip to main content

Module metrics

Module metrics 

Source
Expand description

Engine observability: per-operation traces, ring buffers of recent activity, and log2-bucket latency histograms.

Everything here is cheap enough to stay on in production — an Instant pair and a few integer adds per operation (no allocation on the hot path beyond the trace struct itself).

Structs§

Counters
Degradation counters — “this happened N times” facts that would otherwise vanish into fallback paths. Zero-cost atomics, always on.
CountersSnapshot
Plain-integer, JSON-serializable copy of Counters for the FFI/UI.
Histogram
Log2-bucketed microsecond histogram: bucket i counts values in [2^i, 2^(i+1)) µs. 32 buckets cover > an hour.
IndexStats
Per-column memory accounting for one volume index.
MetricsHub
Thread-safe metrics collector owned by the engine.
MetricsSnapshot
Aggregated, JSON-serializable snapshot for the FFI/UI.
QueryTrace
Stage breakdown of one query, in microseconds.
ScanTrace
One index-established event of a volume: an initial scan/rescan (“scan”) or a snapshot restore (“snapshot”). Sharing one timeline keeps the ≤2s restore gate visible next to full-scan costs.
Stage
Microsecond stopwatch for stage timing.
UsnTrace
One applied USN batch.

Constants§

RING 🔒
SCAN_RING 🔒
USN_RING 🔒

Statics§

LAZY_PERM_REBUILD_FALLBACKS 🔒
OFFSET_TABLE_REBUILD_FALLBACKS 🔒
The query layer has no MetricsHub handle (its degradations normally go through the diag ring — see memo.rs), so these counters are process globals folded into every snapshot.