brave-author-62043
03/24/2026, 6:09 AMtall-airline-16756
03/24/2026, 6:09 AMtall-airline-16756
03/24/2026, 6:09 AMmetrics_collected event.
What you can do now
• Listen for connection quality changes:
◦ Subscribe to the ConnectionQualityChanged event for a participant to receive ConnectionQuality values (Excellent / Good / Poor). Use this to adapt your UI or features when quality degrades.
• Read real-time media stats:
◦ Collect bitrate, packet loss, and frame rate from the client SDK’s stats APIs or from analytics dashboards (LiveKit Cloud or self-hosted exports). Packet loss and bitrate are primary inputs used in the connection quality score.
• For voice-agent latency metrics:
◦ If you’re using LiveKit Agents, use the metrics_collected event to get TTFT, TTFB, and other timing metrics relevant to LLM/TTS flows.
If you need an actual numeric RTT/ping
• Option A — Application-level ping:
a. Implement a simple ping over your LiveKit data channel or signaling channel: send a timestamped message and measure the round-trip time when you get the reply.
b. Average or percentile the RTT samples to smooth noise and monitor trends.
• Option B — WebRTC stats (client-side):
a. On the client, pull WebRTC getStats (or SDK-equivalent) which may expose roundTripTime or related RTT/jitter stats from the RTCPeerConnection.
b. Note: LiveKit’s connection quality score explicitly excludes RTT and jitter from its quality calculation, but you can still collect these values locally for your own monitoring.
Questions to narrow this down
• Which SDK are you using (JS, iOS, Android, or server)? I can provide example code for the appropriate SDK.
• Do you want a binary signal (good/poor) or a numeric RTT value for monitoring or UI display?
• Are you running on LiveKit Cloud or a self-hosted LiveKit server?
If you tell me the SDK and whether you want connection-quality events or raw RTT samples, I’ll provide precise example code and the recommended approach for your use case.
Sources: client-sdk-js | livekit/livekit_composite | DeepWiki | How is Connection Quality determined? | examples/survey | livekit/livekit_composite | DeepWiki | Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit | LLM Metrics | LiveKit Documentation, with interactive elements