buswatch-tui
Terminal UI for real-time message bus monitoring and diagnostics.
Installation
Or build from source:
Usage
Monitor a JSON file
The file should contain a buswatch snapshot.
Connect to a TCP stream
Expects newline-delimited JSON snapshots.
Subscribe to RabbitMQ
Requires the subscribe feature and a config file:
# rabbitmq.toml
[]
= "amqp://127.0.0.1:5672/%2f"
= "caryatid"
Views
Summary (press 1)
Overview of all modules with health status, message counts, rates, and sparklines.
┌─ Summary ────────────────────────────────────────────────────┐
│ Module Reads Rate Writes Pending Status │
│ order-processor 15000 42.5/s 14997 - OK │
│ notification 14500 41.2/s 0 2.3s WARN │
│ analytics 8000 22.1/s 8000 - OK │
└──────────────────────────────────────────────────────────────┘
Bottlenecks (press 2)
Filtered view showing only topics in warning or critical state.
Flow (press 3)
Matrix visualization of module communication patterns.
┌─ Data Flow ──────────────────────────────────────────────────┐
│ orders.new orders.done notifications │
│ order-processor ◀──── ────▶ │
│ notification ◀──── ────▶ │
│ analytics ◀──── ◀──── │
└──────────────────────────────────────────────────────────────┘
Controls
| Key | Action |
|---|---|
1 2 3 |
Switch view |
j / k or ↑ / ↓ |
Navigate |
Enter |
Show detail overlay |
/ |
Search |
s |
Sort by column |
S |
Reverse sort |
e |
Export snapshot to JSON |
? |
Show help |
q |
Quit |
CLI Options
| Option | Default | Description |
|---|---|---|
-f, --file |
monitor.json |
Monitor JSON file path |
-c, --connect |
- | TCP endpoint (host:port) |
-s, --subscribe |
- | RabbitMQ config file |
-t, --topic |
caryatid.monitor.snapshot |
Subscription topic |
-r, --refresh |
1 |
Refresh interval (seconds) |
--pending-warn |
1s |
Pending warning threshold |
--pending-crit |
10s |
Pending critical threshold |
--unread-warn |
1000 |
Unread warning threshold |
--unread-crit |
5000 |
Unread critical threshold |
-e, --export |
- | Export to JSON and exit |
Health Thresholds
Modules are color-coded based on their health:
- Green (OK): All metrics within normal range
- Yellow (WARN): Pending > 1s or backlog > 1000
- Red (CRIT): Pending > 10s or backlog > 5000
Thresholds are configurable via CLI options.
Library Usage
The TUI can also be used as a library for building custom monitoring solutions.
[]
= "0.2"
Custom Data Source
use ;
let source = Boxnew;
let app = new;
Channel Source (for embedding)
use ;
use watch;
// Create a channel for pushing snapshots
let = create;
// Push snapshots from your application
let snapshot = builder
.module
.build;
tx.send.unwrap;
// Create the app
let app = new;
Custom Thresholds
use Thresholds;
use Duration;
let thresholds = Thresholds ;
Examples
See the examples directory:
file_source.rs- Monitor from a JSON filechannel_source.rs- Receive snapshots via channelstream_source.rs- Connect to a TCP stream
Run an example:
Features
| Feature | Description |
|---|---|
subscribe |
RabbitMQ subscription via lapin |
Build with RabbitMQ support: