Hi LiveKit Team, We are currently calculating call...
# ask-ai
m
Hi LiveKit Team, We are currently calculating call duration on our end using the difference between the call start time and the call end time (i.e., duration = end time − start time), which appears to give us accurate results based on our system logs and webhook data . However, we are observing a discrepancy when comparing this with the LiveKit dashboard metrics. For the last day: Our calculated total call duration: 609h 56m 04s • LiveKit dashboard reported usage: 17,530 minutes (~292 hours) This is a significant difference, and we’re trying to understand the root cause. Could you please help clarify:
t
Thanks for reaching out, Aditya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I understand you’re comparing your own call-duration sum (609h 56m) to the LiveKit dashboard’s reported total connection minutes (17,530 minutes ≈ 292h) and want to know why they differ. A few likely reasons for the discrepancy: • LiveKit reports aggregated participant connection minutes (each connected participant adds minutes). If your duration is counting “call time” per room (one timer per call) but the dashboard sums each participant’s connected time, the dashboard total will be lower or higher depending on participant counts and how you measured duration. • The dashboard’s session metrics come from server-side session timers (session/connection time reported by the participant reporter). Those timers are tracked in milliseconds/minutes and then aggregated into “total connection minutes” on the dashboard. • Differences can arise from partial connections, brief reconnects, or failed/short sessions: ◦ Short failed connections or very brief reconnect attempts may be included or excluded differently between your logs and the dashboard. ◦ If you measure only from a room’s “start” to “end” event but participants join/leave at different times, your room-based duration won’t match per-participant connection minutes. • Time-zone, rounding, or truncation rules used when converting milliseconds to minutes may change totals slightly when aggregated at scale. To reconcile the numbers quickly, could you tell me: 1. Do your 609h+ figures measure (A) room-level call duration (single timer per call) or (B) sum of each participant’s connected time? 2. Are you using webhook events or client logs to compute start/end times? If webhook, which events (e.g., room.started/room.ended, participant.joined/participant.left)? With those details I’ll recommend the exact mapping between your method and the dashboard metric and steps to align them. Sources: server-sdk-go | livekit/livekit_composite | DeepWiki | Say hello to improved Cloud analytics | LiveKit | Say hello to improved Cloud analytics | LiveKit, with interactive elements
m
1. (A) room-level call duration (single timer per call) 2. • We calculate duration on the server side using our agent lifecycle: • Call start time is captured when the session begins (
call_start_time
) • Call duration is computed at the end as: duration = current_time − call_start_time • This is triggered via our backend flow tied to LiveKit session lifecycle (effectively aligned with room start/end), and not from client-side logs.
t
Thanks — that’s very helpful context. You said you’re using a single room-level timer (start when the session begins, end at session end). That explains the gap: the LiveKit dashboard reports total participant connection minutes, not room-level durations. What that means: • Your 609h measures each room’s elapsed time once per call. • The dashboard sums each participant’s connected time (each participant-minute counts toward the total). If rooms have fewer than one participant on average, or if participants join/leave for portions of the room lifetime, the dashboard total will differ — often lower — than a simple room-level sum. Next steps to reconcile the numbers: 1. If you want a dashboard-comparable metric, compute sum(participant_end − participant_start) across all participants instead of room_end − room_start. 2. If you prefer room-level totals, keep using your current method but expect different values from LiveKit’s “connection minutes.” 3. To match precisely, tell me whether you can export participant join/leave events (webhooks or server-side participant reports). If yes, I can outline the exact webhook events or telemetry fields to use to reproduce the dashboard total. Which metric do you want to align to — the dashboard’s participant-minutes or your room-level totals? , with interactive elements