Expand description
Opt-in terminal dashboard for live metrics (RLG_TUI=1).
Opt-in terminal dashboard for live observability metrics.
Set RLG_TUI=1 to spawn a background render thread that paints a
non-clobbering sparkline dashboard at ~60 FPS. Enable the tui feature
for automatic terminal size detection; otherwise falls back to 80x24.
Structsยง
- TuiMetrics
- Atomic counters for the TUI dashboard. Cache-line aligned (
repr(align(64))).
Constantsยง
- DEFAULT_
TERMINAL_ ๐HEIGHT - Default terminal height when detection fails.
- DEFAULT_
TERMINAL_ ๐WIDTH - Default terminal width when detection fails.
- LEVEL_
BAR_ ๐WIDTH - Width of level-distribution bar charts (in block characters).
- SPARKLINE_
RING_ ๐SIZE - Number of throughput samples in the sparkline ring buffer (one per tick).
- SPARK_
CHARS ๐ - Sparkline characters indexed by intensity (0..=7).
- TUI_
TICK_ ๐INTERVAL_ MS - TUI render interval in milliseconds (~60 FPS).
Functionsยง
- build_
fmt_ line - Builds the format counts line from metrics.
- compute_
level_ bars - Computes level bar rendering from metrics.
- format_
uptime ๐ - Formats an uptime duration as HH:MM:SS.
- format_
with_ ๐commas - Formats an integer with comma separators.
- get_
terminal_ ๐height - get_
terminal_ height_ of - Returns the terminal height for the given handle, or 24 as fallback.
- get_
terminal_ ๐width - Returns the terminal width, or
DEFAULT_TERMINAL_WIDTHas fallback. - render_
level_ ๐bar - Renders a level bar: filled blocks + empty blocks,
LEVEL_BAR_WIDTHchars wide. - render_
sparkline ๐ - Renders a sparkline string from a circular buffer of throughput samples.
- render_
tick - Performs one tick of the TUI dashboard, returning the ANSI-formatted frame.
- spawn_
tui_ thread - Spawns the background TUI renderer thread.