Skip to main content
getCpuLoadStats() Returns a snapshot of the current CPU load state and video encode/decode statistics. Stats in the latest field are updated approximately every two seconds — poll this method to monitor CPU performance over time.
Applies to video calls only.

Return value

Returns a Promise<DailyCpuLoadStats>:
cpuLoadState
string
Current CPU load assessment: 'low' or 'high'.
cpuLoadStateReason
string
Reason for the current state:
  • 'none' — load is low
  • 'encode' — video encoding is the primary cause of high load
  • 'decode' — video decoding is the primary cause of high load
  • 'scheduleDuration' — Daily code is not completing within its scheduled interval
stats.latest
object
Statistics from the most recent measurement period.

Example

const { cpuLoadState, cpuLoadStateReason, stats } = await call.getCpuLoadStats();

if (cpuLoadState === 'high') {
  console.log('High CPU load — reason:', cpuLoadStateReason);
  // Consider reducing video quality
  call.updateSendSettings({ video: { maxQuality: 'low' } });
}

See also