| Crates.io | buswatch-tui |
| lib.rs | buswatch-tui |
| version | 0.1.1 |
| created_at | 2025-12-22 17:27:31.049805+00 |
| updated_at | 2025-12-22 17:29:57.150203+00 |
| description | Diagnostic TUI for monitoring Caryatid message bus activity |
| homepage | |
| repository | https://github.com/lowhung/buswatch |
| max_upload_size | |
| id | 2000059 |
| size | 245,332 |
Terminal UI for real-time message bus monitoring and diagnostics.
cargo install buswatch
Or build from source:
cargo build -p buswatch-tui --release
buswatch -f monitor.json
The file should contain a buswatch snapshot.
buswatch --connect localhost:9090
Expects newline-delimited JSON snapshots.
buswatch --subscribe rabbitmq.toml --topic caryatid.monitor.snapshot
Requires the subscribe feature and a config file:
# rabbitmq.toml
[rabbitmq]
url = "amqp://127.0.0.1:5672/%2f"
exchange = "caryatid"
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 │
└──────────────────────────────────────────────────────────────┘
2)Filtered view showing only topics in warning or critical state.
3)Matrix visualization of module communication patterns.
┌─ Data Flow ──────────────────────────────────────────────────┐
│ orders.new orders.done notifications │
│ order-processor ◀──── ────▶ │
│ notification ◀──── ────▶ │
│ analytics ◀──── ◀──── │
└──────────────────────────────────────────────────────────────┘
| 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 |
| 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 |
Modules are color-coded based on their health:
Thresholds are configurable via CLI options.
The TUI can also be used as a library for building custom monitoring solutions.
[dependencies]
buswatch-tui = "0.2"
use buswatch_tui::{App, FileSource, Thresholds};
let source = Box::new(FileSource::new("monitor.json"));
let app = App::new(source, Thresholds::default());
use buswatch_tui::{App, ChannelSource, Thresholds, Snapshot};
use tokio::sync::watch;
// Create a channel for pushing snapshots
let (tx, source) = ChannelSource::create("my-app");
// Push snapshots from your application
let snapshot = Snapshot::builder()
.module("my-module", |m| {
m.read("input", |r| r.count(100).backlog(5))
})
.build();
tx.send(snapshot).unwrap();
// Create the app
let app = App::new(Box::new(source), Thresholds::default());
use buswatch_tui::Thresholds;
use std::time::Duration;
let thresholds = Thresholds {
pending_warning: Duration::from_secs(2),
pending_critical: Duration::from_secs(30),
unread_warning: 500,
unread_critical: 2000,
};
See the examples directory:
file_source.rs - Monitor from a JSON filechannel_source.rs - Receive snapshots via channelstream_source.rs - Connect to a TCP streamRun an example:
cargo run -p buswatch-tui --example file_source -- path/to/monitor.json
| Feature | Description |
|---|---|
subscribe |
RabbitMQ subscription via lapin |
Build with RabbitMQ support:
cargo build -p buswatch-tui --features subscribe