From cf8950110f4866c1df62d1f03d8341d5bed05bd5 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Tue, 6 Oct 2015 16:36:41 -0500 Subject: [PATCH] Adds additional logs, including timestamps relative to the initial request. --- app.js | 3 +++ index.html | 1 + modules/UI/videolayout/SmallVideo.js | 5 +++++ modules/xmpp/JingleSessionPC.js | 3 ++- modules/xmpp/strophe.emuc.js | 2 ++ modules/xmpp/strophe.jingle.js | 2 ++ modules/xmpp/xmpp.js | 5 +++-- 7 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 6a4e44c50..5170e2295 100644 --- a/app.js +++ b/app.js @@ -60,6 +60,8 @@ function obtainConfigAndInit() { // Get config result callback function(success, error) { if (success) { + console.log("(TIME) configuration fetched:\t", + window.performance.now()); init(); } else { // Show obtain config error, @@ -75,6 +77,7 @@ function obtainConfigAndInit() { $(document).ready(function () { + console.log("(TIME) document ready:\t", window.performance.now()); var URLProcessor = require("./modules/config/URLProcessor"); URLProcessor.setConfigParametersFromUrl(); diff --git a/index.html b/index.html index 7584d1fd6..3844813bf 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,7 @@ + diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index 20ea7ce39..0bce83fc3 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -117,6 +117,11 @@ SmallVideo.createStreamElement = function (stream) { element.id = (isVideo ? 'remoteVideo_' : 'remoteAudio_') + APP.RTC.getStreamID(stream); + element.onplay = function() { + console.log("(TIME) Render " + (isVideo ? 'video' : 'audio') + ":\t", + window.performance.now()); + }; + element.oncontextmenu = function () { return false; }; return element; diff --git a/modules/xmpp/JingleSessionPC.js b/modules/xmpp/JingleSessionPC.js index 2fa407649..23c2d1667 100644 --- a/modules/xmpp/JingleSessionPC.js +++ b/modules/xmpp/JingleSessionPC.js @@ -142,7 +142,8 @@ JingleSessionPC.prototype.doInitialize = function () { */ this.peerconnection.oniceconnectionstatechange = function (event) { if (!(self && self.peerconnection)) return; - console.info("Ice: " + self.peerconnection.iceConnectionState); + console.log("(TIME) ICE " + self.peerconnection.iceConnectionState + + ":\t", window.performance.now()); self.updateModifySourcesQueue(); switch (self.peerconnection.iceConnectionState) { case 'connected': diff --git a/modules/xmpp/strophe.emuc.js b/modules/xmpp/strophe.emuc.js index e4a7b1076..b37918e0d 100644 --- a/modules/xmpp/strophe.emuc.js +++ b/modules/xmpp/strophe.emuc.js @@ -234,6 +234,8 @@ module.exports = function(XMPP, eventEmitter) { } if (!this.joined) { this.joined = true; + console.log("(TIME) MUC joined:\t", + window.performance.now()); eventEmitter.emit(XMPPEvents.MUC_JOINED, from, member); this.list_members.push(from); } diff --git a/modules/xmpp/strophe.jingle.js b/modules/xmpp/strophe.jingle.js index 7fc87128e..42599caa8 100644 --- a/modules/xmpp/strophe.jingle.js +++ b/modules/xmpp/strophe.jingle.js @@ -95,6 +95,8 @@ module.exports = function(XMPP, eventEmitter) { // see http://xmpp.org/extensions/xep-0166.html#concepts-session switch (action) { case 'session-initiate': + console.log("(TIME) received session-initiate:\t", + window.performance.now()); var startMuted = $(iq).find('jingle>startmuted'); if (startMuted && startMuted.length > 0) { var audioMuted = startMuted.attr("audio"); diff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.js index ba8111562..a95dcb39b 100644 --- a/modules/xmpp/xmpp.js +++ b/modules/xmpp/xmpp.js @@ -80,8 +80,9 @@ function connect(jid, password) { var connectionFailed = false; var lastErrorMsg; connection.connect(jid, password, function (status, msg) { - console.log('Strophe status changed to', - Strophe.getStatusString(status), msg); + console.log("(TIME) Strophe " + Strophe.getStatusString(status) + + (msg ? "[" + msg + "]" : "") + + "\t:" + window.performance.now()); if (status === Strophe.Status.CONNECTED) { if (config.useStunTurn) { connection.jingle.getStunAndTurnCredentials();