Skip to main content

Module progress

Module progress 

Source
Available on crate feature cli-progress only.
Expand description

Inline live progress for faucet run (#385, cli-progress feature).

A lightweight alternative to the full-screen --tui: one indicatif line per active matrix-row invocation showing records in/out, rows/sec, pages, and elapsed time, updated a few times a second while the run streams. Numbers come from the same in-process Prometheus recorder the TUI samples (crate::livemetrics) — no new measurement plumbing on the hot path.

Rendered on stderr so a piped stdout stays clean for records; logs also go to stderr, and indicatif suspends its lines while a log line prints so the two don’t interleave. The live line is only drawn on an interactive terminal — a non-TTY stdout (CI, pipes) or --quiet disables it and the run falls back to the periodic tracing progress logs. --tui takes precedence when both are requested.

Functions§

drive
Drive the run future while rendering one inline progress line per active row. Returns the run’s result after the lines are finalized. The recorder handle is the same one livemetrics::setup_observability installed.
format_row_line
Format one row’s live line: <row> <src>→<sink> <in> in / <out> out <rate>/s page <p> <elapsed>. Pure so it can be unit-tested without a terminal.
is_progress_session
Should the inline progress line render? Requires an interactive terminal on both stdout and stderr (progress draws to stderr; the piped-stdout fallback is keyed on stdout per the issue), and neither --quiet nor --tui. On any non-TTY or when suppressed the caller keeps the periodic log output instead.