WebRTC-内部度量文件的分析

70 阅读1分钟
AbstractWebRTC stats analyze
AuthorsWalter Fan
 Category   webrtc note  
Statusv1.0
Updated2023-07-01
LicenseCC-BY-NC-ND 4.0

Overview

在 WebRTC 的开发过程中, 我们看的最多的度量数据来自 getStats 接口, 我接触 WebRTC 开发的第一个任务就是定时调用这个接口, 获取, 分析并计算出相应的度量数据, 发送到远程的 ElasticSearch 中做进一步分析.

日常做 QoS 调优时, 看的最多的就是 WebRTC stats

  • chrome://webrtc-internals/ in chrome,
  • edge://webrtc-internals/ in edge
  • about:webrtc in firefox

主要有如下状态信息以及度量数据:

  • ICE connection state
  • Signaling state
  • ICE candidate grid
  • ICE connection candidate pair and related metrics
  • Inbound RTP and remote inbound RTP stream metrics
  • Outbound RTP and remote outbound RTP stream metrics

下列类别的度量指标

  • Candidate-pair
  • Local-candidate
  • Remote-candidate
  • Inbound-rtp
  • Outbound-rtp
  • Opus codec: maxaveragebitrate, maxplaybackrate, stereo, useinbandfec, etc.
  • H264 codec: level-asymmetry-allowed, max-br, max-dpb, max-fps, max-fs, max-mbps, packetization-mode, profile-level-id, id, etc.

以前写过一篇相关的笔记 WebRTC 之度量与统计: 到底出了什么问题

这篇笔记主要是总结了一下webrtc internal dump 的结构以及我写的分析工具,完整内容不知道哪里有问题,简书上发不出来,请参见www.fanyamin.com/blog/webrtc…