Expand description
MQTT Broker Performance Monitoring System
Provides comprehensive metrics collection with:
- 50+ operational metrics
- Thread-safe atomic counters
- Categorized event tracking
- Serialization support
§Metric Categories
-
Client Lifecycle:
- Authentication attempts/successes
- Connection establishment
- Subscription management
- ACL verification
-
Session Tracking:
- Creation/resumption
- Subscription changes
- Termination events
-
Message Processing:
- Publish/delivery/ack flows
- Message drops
- Non-subscribed messages
- QoS-specific tracking
-
Message Types:
- Custom messages
- Admin messages
- Last Will messages
- System messages
- Bridge messages
- Retained messages
§Key Features
- Atomic counters for thread safety
- Automatic derive macros for metrics operations
- Serde serialization support
- Zero-overhead when disabled
- Categorized counters for detailed analysis
§Implementation Details
- Uses AtomicUsize for lock-free counting
- Macro-generated metric operations
- Organized by logical categories
- Designed for monitoring systems integration
Usage Patterns:
- Increment counters at relevant code points
- Serialize for external monitoring
- Analyze trends across metric categories
Note: All metrics are optional - only enabled counters incur measurement overhead.