Skip to main content
1

Install the library and CLI

Add the dbgflow crate to your project and install the CLI tool:
dbgflow requires Rust 1.85 or later. Run rustup update stable if you are on an older toolchain.
2

Run the built-in demo

Before touching your own code, run the demo to confirm the toolchain is working and to see what the UI looks like:
This generates a sample session at artifacts/demo-session.json and opens the browser UI at http://127.0.0.1:3000.You will see two pipelines in the graph — one with a simulated test failure and one with a passing test. Use the playback controls at the bottom of the screen to step through execution events.
You can pass --port 8080 (or any other port) if 3000 is already in use.
3

Instrument your code

Import the prelude, mark the types you want to inspect with #[ui_debug], and mark the functions you want to trace with #[trace]:
  • #[ui_debug] registers the type as a data node in the graph and makes emit_snapshot available on it. Call emit_snapshot at any point to capture the current field values.
  • #[trace] marks a function as a graph node. Every call is recorded as a pair of function_enter / function_exit events.
To link a test to the graph, annotate it with #[dbg_test]:
#[dbg_test] does not support async tests. Use it only on synchronous test functions.
4

Run tests with session capture

Use dbgflow test instead of cargo test to capture execution sessions while your tests run:
To target a specific project or pass extra arguments to cargo test:
Sessions are saved to artifacts/test-sessions/run-<timestamp>/ by default — one JSON file per #[dbg_test] function.
dbgflow test always sets RUST_TEST_THREADS=1 so that session capture stays deterministic. If your tests rely on parallel execution, be aware of this constraint.
5

Explore the browser UI

When the --serve flag is present, the browser opens automatically after tests complete, focused on the first failing test session.Here is what you will find in the UI:Graph canvas — Each #[trace] function appears as a function node (marked fn), each #[ui_debug] type as a data node (marked db), and each #[dbg_test] test as a test node (marked t). Edges show call relationships and test-to-function links. Node colors indicate status: gray for idle, orange for running, green for success, and red for failure.Left panel — Click any node to open the detail panel. It shows the node type, execution status, the function’s source code with Rust syntax highlighting, captured input arguments, and all snapshots emitted during the call. Drag the panel edge to resize it.Playback controls — The bar at the bottom lets you play, pause, step forward and backward, scrub the timeline, switch between pipelines, jump to a specific event by number, and adjust playback speed from 0.25x to 4x.Canvas navigation — Scroll to zoom. Use the canvas mode toggle to switch between panning the viewport and dragging individual nodes to reposition them.