Expand description
Low-distortion performance instrumentation for fdu.
The subsystem has two complementary tiers:
- application counters attribute logical work to the filesystem, memory, and index layers;
processsamples kernel counters at phase boundaries and exposes only metrics supported by the current platform.
Recording is compiled in, off by default, and enabled with FDU_COUNTERS=1 by the
shipped CLI and the repository performance probe. Per-event updates stay thread-local;
workers fold their counts on exit, while a drop fallback preserves counts from callers
that do not install an explicit worker guard.
Modules§
- alloc
- A global allocator wrapper with certified, non-reentrant counter sinks.
- process
- Kernel-reported process counters sampled at phase boundaries.
Structs§
- Counts
- Per-layer tallies for a walk, index build, and content pass.
- Measurement
- One opt-in instrumentation interval for a binary invocation.
Functions§
- bump
- Add to one or more counters on the calling thread.
- enable
- Turn recording on or off for the whole process.
- enable_
from_ env - Turn recording on when
FDU_COUNTERScontains a truthy value. - enabled
- Whether recording is currently on.
- flush_
thread - Fold this thread’s counts into the process total and clear them.
- render
- Render application counters followed by the supported kernel process counters.
- reset
- Clear process totals and the calling thread’s local counts.
- snapshot
- Process-wide totals, including the calling thread’s unflushed counts.
- system_
allocator - Create fdu’s certified system-allocator wrapper for a binary’s global allocator.
- thread_
snapshot - The calling thread’s unflushed counts, without consuming them.