From 06c636311d8b540f18c16d3fab90bc8710343b04 Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 3 Aug 2016 11:08:23 -0500 Subject: [PATCH 1/2] Adds analytics event and console log for TTFM (time to first media). --- conference.js | 6 ++++++ modules/UI/videolayout/SmallVideo.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/conference.js b/conference.js index c9304b6b3..d50c669e0 100644 --- a/conference.js +++ b/conference.js @@ -628,6 +628,12 @@ export default { sendFeedback (overallFeedback, detailedFeedback) { return room.sendFeedback (overallFeedback, detailedFeedback); }, + /** + * Returns the connection times stored in the library. + */ + getConnectionTimes () { + return this._room.getConnectionTimes(); + }, // used by torture currently isJoined () { return this._room diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index 801b90b52..929967a48 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -167,6 +167,12 @@ SmallVideo.createStreamElement = function (stream) { console.log("(TIME) Render " + type + ":\t", now); AnalyticsAdapter.sendEvent('render.' + type, now); + + var ttfm = now - APP.connectionTimes["document.ready"] + - (APP.conference.getConnectionTimes()["session.initiate"] + - APP.conference.getConnectionTimes()["muc.joined"]); + console.log("(TIME) TTFM " + type + ":\t", ttfm); + AnalyticsAdapter.sendEvent('ttfm.' + type, ttfm); }; return element; }; From df01358fb817ac022056f3743babf1fd3e9df8ed Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 3 Aug 2016 12:49:19 -0500 Subject: [PATCH 2/2] Adds comment. --- modules/UI/videolayout/SmallVideo.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index 929967a48..723aaefba 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -168,6 +168,11 @@ SmallVideo.createStreamElement = function (stream) { now); AnalyticsAdapter.sendEvent('render.' + type, now); + // Time to first media, a number that can be used for comparision of + // time fot rendering media. It can be used for the first and + // the rest participants. It subtracts the period of waiting for the + // second participant to join (time between join and first + // session initiate). var ttfm = now - APP.connectionTimes["document.ready"] - (APP.conference.getConnectionTimes()["session.initiate"] - APP.conference.getConnectionTimes()["muc.joined"]);