Skip to main content

Crate vor

Crate vor 

Source
Expand description

Cross-platform performance instrumentation.

Tag a function with #[vor::profile], a whole impl with #[vor::all_functions], or open a scoped block with profile_scope!. Each tag emits a puffin scope (frame-buffer source for an in-app flame chart), a tracing span (sink source: Chrome-trace file on mac, DevTools timeline on web), and — under the cuda feature — an NVTX range for NVIDIA Nsight Systems.

Frame boundaries: call frame_mark once per rendered frame so puffin can group scopes by frame.

Macros§

profile_scope
Open a profiling scope for the rest of the enclosing block.

Structs§

Frame
One captured frame.
FrameStats
Streaming p50 / p95 / p99 over per-frame nanosecond samples.
Guard
Opaque per-process guard. Drop to flush.
IoTick
Snapshot of one frame’s I/O totals.
MetricColumn
A metric column from a capture: name + unit, for labeling the plotted row.
Reader
Streaming reader over a .vor capture.
ScopeGuard
Open guard for a runtime-named scope; the scope closes when it drops.
SystemSample
One frame’s worth of vor-owned system metrics.

Traits§

Sink
A profiler backend.

Functions§

calibrate
Measure the per-span overhead of tracing::trace_span.
current_memory_bytes
drain_io
Read + reset the I/O accumulator. Call once per rendered frame (after frame_mark) so the next frame’s totals start from zero.
empty_span_ns
enable
Turn on puffin scope collection process-wide.
flush_recording
Block until every captured frame is written to the VOR_RECORD stream. No-op when not recording. Call before exit so a reader sees the run’s final frames.
frame_mark
Mark a frame boundary in puffin’s ring buffer.
record_io
Add one I/O event to the current frame’s totals.
record_metric
Record the latest value of a named scalar for the current frame.
record_metric_unit
Attach a unit (e.g. "ms", "tok/s") to a named metric’s plotted row, once. The recorder reads it when it first declares the column, so call this before the metric’s first record_metric (e.g. at startup). Metrics with no registered unit are unitless.
scope
Open a profiling scope named at run time, the dynamic counterpart to profile_scope!. The returned guard closes the scope on drop, and the scope shows in the flame chart under name.

Attribute Macros§

all_functions
#[all_functions] — profile every method in an impl block.
profile
#[profile] — tag a function or method as a profiling scope.
skip
#[skip] — exclude a method from an enclosing all_functions.