1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! # buswatch-sdk
//!
//! Instrumentation SDK for emitting message bus metrics to buswatch.
//!
//! This crate provides a simple API for instrumenting any message bus system
//! to emit metrics that can be consumed by buswatch or other monitoring tools.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use buswatch_sdk::{Instrumentor, Output};
//! use std::time::Duration;
//!
//! #[tokio::main]
//! async fn main() {
//! // Create an instrumentor that emits snapshots every second
//! let instrumentor = Instrumentor::builder()
//! .output(Output::file("metrics.json"))
//! .interval(Duration::from_secs(1))
//! .build();
//!
//! // Register a module and get a handle for recording metrics
//! let handle = instrumentor.register("my-service");
//!
//! // Record metrics as your service processes messages
//! handle.record_read("orders.new", 1);
//! handle.record_write("orders.processed", 1);
//!
//! // Start background emission (non-blocking)
//! instrumentor.start();
//!
//! // ... your application runs ...
//! }
//! ```
//!
//! ## Features
//!
//! - **Simple API**: Just `record_read()` and `record_write()`
//! - **Multiple outputs**: File, TCP, or custom channel
//! - **Background emission**: Automatic periodic snapshots
//! - **Thread-safe**: Use from any thread or async task
//! - **Low overhead**: Lock-free counters where possible
pub use ModuleHandle;
pub use ;
pub use Output;
pub use ;
// Re-export types for convenience
pub use ;