UserBotLatencyLogObserver
measures the time between when a user stops speaking and when the bot starts responding, providing metrics for conversational AI performance optimization.
Features
- Tracks user speech start/stop timing
- Measures bot response latency
- Calculates statistics: average, minimum, maximum
- Provides real-time latency logging
- Automatically resets between conversation turns
Usage
Basic Latency Monitoring
Add latency monitoring to your pipeline:How It Works
The observer tracks conversation flow through these key events:- User starts speaking → Resets latency tracking
- User stops speaking → Records timestamp
- Bot starts speaking → Calculates and logs latency
- Pipeline ends → Reports session latency statistics
Log Output
Real-time Latency Logs
During conversation, each response latency is logged:Final Statistics
When the pipeline ends, comprehensive statistics are reported:Limitations
- Only measures speech-to-speech latency (not text processing time)
- Requires proper frame sequencing to work accurately