瀏覽代碼

Make the PeerConnection stats interval configurable, bump the default to 10s. (#1033)

dev1
bgrozev 5 年之前
父節點
當前提交
b24bbdee4e
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 5 行新增1 行删除
  1. 5
    1
      modules/statistics/statistics.js

+ 5
- 1
modules/statistics/statistics.js 查看文件

@@ -110,6 +110,9 @@ function formatJitsiTrackErrorForCallStats(error) {
110 110
  */
111 111
 Statistics.init = function(options) {
112 112
     Statistics.audioLevelsEnabled = !options.disableAudioLevels;
113
+    if (typeof options.pcStatsInterval === 'number') {
114
+        Statistics.pcStatsInterval = options.pcStatsInterval;
115
+    }
113 116
 
114 117
     if (typeof options.audioLevelsInterval === 'number') {
115 118
         Statistics.audioLevelsInterval = options.audioLevelsInterval;
@@ -186,6 +189,7 @@ export default function Statistics(xmpp, options) {
186 189
 }
187 190
 Statistics.audioLevelsEnabled = false;
188 191
 Statistics.audioLevelsInterval = 200;
192
+Statistics.pcStatsInterval = 10000;
189 193
 Statistics.disableThirdPartyRequests = false;
190 194
 Statistics.analytics = analytics;
191 195
 
@@ -216,7 +220,7 @@ Statistics.prototype.startRemoteStats = function(peerconnection) {
216 220
             = new RTPStats(
217 221
                 peerconnection,
218 222
                 Statistics.audioLevelsInterval,
219
-                2000,
223
+                Statistics.pcStatsInterval,
220 224
                 this.eventEmitter);
221 225
 
222 226
         rtpStats.start(Statistics.audioLevelsEnabled);

Loading…
取消
儲存