Kaynağa Gözat

feat(p2p): log analytics event

Log when P2P succeeds or fails. Also log when a conference switches
back to the JVB connection.
dev1
paweldomas 8 yıl önce
ebeveyn
işleme
5c1913f9da
1 değiştirilmiş dosya ile 13 ekleme ve 0 silme
  1. 13
    0
      JitsiConference.js

+ 13
- 0
JitsiConference.js Dosyayı Görüntüle

1839
     // We do nothing for the JVB connection, because it's up to the Jicofo to
1839
     // We do nothing for the JVB connection, because it's up to the Jicofo to
1840
     // eventually come up with the new offer (at least for the time being).
1840
     // eventually come up with the new offer (at least for the time being).
1841
     if (session.isP2P) {
1841
     if (session.isP2P) {
1842
+        if (this.p2pJingleSession && this.p2pJingleSession.isInitiator) {
1843
+            Statistics.sendEventToAll('p2p.ice_failed');
1844
+        }
1842
         this._stopP2PSession('connectivity-error', 'ICE FAILED');
1845
         this._stopP2PSession('connectivity-error', 'ICE FAILED');
1843
     }
1846
     }
1844
 };
1847
 };
1963
     // Start remote stats
1966
     // Start remote stats
1964
     logger.info('Starting remote stats with p2p connection');
1967
     logger.info('Starting remote stats with p2p connection');
1965
     this._startRemoteStats();
1968
     this._startRemoteStats();
1969
+
1970
+    // Log the P2P established event
1971
+    if (this.p2pJingleSession.isInitiator) {
1972
+        Statistics.sendEventToAll('p2p.established');
1973
+    }
1966
 };
1974
 };
1967
 
1975
 
1968
 /**
1976
 /**
2184
         }
2192
         }
2185
     } else if (isModerator && this.p2pJingleSession && !shouldBeInP2P) {
2193
     } else if (isModerator && this.p2pJingleSession && !shouldBeInP2P) {
2186
         logger.info(`Will stop P2P with: ${this.p2pJingleSession.peerjid}`);
2194
         logger.info(`Will stop P2P with: ${this.p2pJingleSession.peerjid}`);
2195
+
2196
+        // Log that there will be a switch back to the JVB connection
2197
+        if (this.p2pJingleSession.isInitiator && peerCount > 1) {
2198
+            Statistics.sendEventToAll('p2p.switch_to_jvb');
2199
+        }
2187
         this._stopP2PSession();
2200
         this._stopP2PSession();
2188
     }
2201
     }
2189
 };
2202
 };

Loading…
İptal
Kaydet