소스 검색

fix(JSPC): do not report gathering time twice

tags/v0.0.2
paweldomas 8 년 전
부모
커밋
670144e013
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11
    1
      modules/xmpp/JingleSessionPC.js

+ 11
- 1
modules/xmpp/JingleSessionPC.js 파일 보기

89
          */
89
          */
90
         this._gatheringStartedTimestamp = null;
90
         this._gatheringStartedTimestamp = null;
91
 
91
 
92
+        /**
93
+         * Marks that ICE gathering duration has been reported already. That
94
+         * prevents reporting it again, after eventual 'transport-replace' (JVB
95
+         * conference migration/ICE restart).
96
+         * @type {boolean}
97
+         * @private
98
+         */
99
+        this._gatheringReported = false;
100
+
92
         this.lasticecandidate = false;
101
         this.lasticecandidate = false;
93
         this.closed = false;
102
         this.closed = false;
94
 
103
 
259
                         }
268
                         }
260
                     }
269
                     }
261
                 }
270
                 }
262
-            } else {
271
+            } else if (!this._gatheringReported) {
263
                 // End of gathering
272
                 // End of gathering
264
                 let eventName = this.isP2P ? 'p2p.ice.' : 'ice.';
273
                 let eventName = this.isP2P ? 'p2p.ice.' : 'ice.';
265
 
274
 
268
                 Statistics.analytics.sendEvent(
277
                 Statistics.analytics.sendEvent(
269
                     eventName,
278
                     eventName,
270
                     { value: now - this._gatheringStartedTimestamp });
279
                     { value: now - this._gatheringStartedTimestamp });
280
+                this._gatheringReported = true;
271
             }
281
             }
272
             this.sendIceCandidate(candidate);
282
             this.sendIceCandidate(candidate);
273
         };
283
         };

Loading…
취소
저장