buswatch
# _______ ____ ____ ________ __ __ ___ __ ___________ ______ __ __
# | _ "\ (" _||_ " | /" )|" |/ \| "| /""\(" _ ")/" _ "\ /" | | "\
# (. |_) :)| ( ) : |(: \___/ |' / \: | / \)__/ \\__/(: ( \___)(: (__) :)
# |: \/ (: | | . ) \___ \ |: /' | /' /\ \ \\_ / \/ \ \/ \/
# (| _ \\ \\ \__/ // __/ \\ \// /\' | // __' \ |. | // \ _ // __ \\
# |: |_) :) /\\ __ //\ /" \ :) / / \\ | / / \\ \\: | (: _) \ (: ( ) :)
# (_______/ (__________)(_______/ |___/ \___|(___/ \___)\__| \_______) \__| |__/
#
A diagnostic TUI for monitoring Caryatid message bus activity.
Installation
From crates.io
From source
Usage
# Monitor a JSON file (default mode)
# Connect to a TCP stream
# Subscribe to RabbitMQ (requires --features subscribe)
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 |
Views
| View | Key | Description |
|---|---|---|
| Summary | 1 |
Module overview with health status, rates, and sparklines |
| Bottlenecks | 2 |
Topics in warning/critical state |
| Flow | 3 |
Module communication patterns |
Controls
| Key | Action |
|---|---|
1 2 3 |
Switch view |
j/k or arrows |
Navigate |
Enter |
Detail overlay |
/ |
Search |
s / S |
Sort / reverse |
e |
Export |
? |
Help |
q |
Quit |
RabbitMQ Subscription
Build with the subscribe feature:
Create a config file:
# rabbitmq.toml
[]
= "amqp://127.0.0.1:5672/%2f"
= "caryatid"
Enable publishing in your Caryatid process:
[]
= "caryatid.monitor.snapshot"
= 5.0
[[]]
= "caryatid.monitor.*"
= "external"
Message Format
buswatch auto-detects the message format, supporting both:
- CBOR - Caryatid's native format (compact binary, used by default)
- JSON - Fallback for compatibility
No configuration needed - it just works.
Health Thresholds
Modules are marked unhealthy based on:
- Pending duration: Time waiting on reads/writes
- Unread count: Backlog of unread messages
A module's status is the worst across all its topics.
Library Usage
buswatch can also be used as a library for building custom monitoring solutions.
Add to your Cargo.toml:
[]
= "0.1"
Examples
See the examples directory for runnable examples:
file_source.rs- Monitor from a JSON filechannel_source.rs- Receive snapshots via channelstream_source.rs- Connect to a TCP stream
use ;
let source = Boxnew;
let app = new;
Features
| Feature | Description |
|---|---|
subscribe |
RabbitMQ integration via lapin |
Enable features:
Or in Cargo.toml:
[]
= { = "0.1", = ["subscribe"] }
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.