Module perf

Module perf 

Source
Expand description

Cross-cutting performance instrumentation.

This module provides instruction-count measurement primitives used across endpoints, ops, timers, and background tasks.

It is intentionally crate-level infrastructure, not part of the domain layering (endpoints → ops → model). Instrumentation modules are layer-neutral and may be used anywhere.

Structs§

PerfEntry
PerfEntry Aggregated perf counters keyed by kind (endpoint vs timer) and label.

Enums§

PerfKey
PerfKey splitting up by Timer type to avoid confusing string comparisons

Constants§

PERF_LAST
Last snapshot used by the perf! macro.

Functions§

entries
Snapshot all recorded perf counters, sorted by key. Entries are sorted by (kind, label).
perf_counter
Returns the call-context instruction counter for the current execution.
record
Record a counter under the provided key.
record_endpoint
record_timer