From 8d77088f6d86acd837a32c51a83a4e9227bf64ee Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Fri, 1 Apr 2016 14:44:25 -0500 Subject: [PATCH] Stores measured times and exposes them --- app.js | 13 ++++++++++--- conference.js | 2 +- index.html | 5 ++++- modules/UI/videolayout/SmallVideo.js | 4 +++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index cee8118e8..277cbb161 100644 --- a/app.js +++ b/app.js @@ -51,9 +51,14 @@ const APP = { status: "initialized", handler: null }, + // Used for automated performance tests + performanceTimes: { + "index.loaded": window.indexLoadedTime + }, UI, settings, conference, + connection: null, API, init () { this.keyboardshortcut = @@ -98,8 +103,9 @@ function obtainConfigAndInit() { // Get config result callback function(success, error) { if (success) { - console.log("(TIME) configuration fetched:\t", - window.performance.now()); + var now = APP.performanceTimes["configuration.fetched"] = + window.performance.now(); + console.log("(TIME) configuration fetched:\t", now); init(); } else { // Show obtain config error, @@ -118,7 +124,8 @@ function obtainConfigAndInit() { $(document).ready(function () { - console.log("(TIME) document ready:\t", window.performance.now()); + var now = APP.performanceTimes["document.ready"] = window.performance.now(); + console.log("(TIME) document ready:\t", now); URLProcessor.setConfigParametersFromUrl(); APP.init(); diff --git a/conference.js b/conference.js index bc8775e81..c68857899 100644 --- a/conference.js +++ b/conference.js @@ -328,7 +328,7 @@ export default { ]); }).then(([tracks, con]) => { console.log('initialized with %s local tracks', tracks.length); - connection = con; + APP.connection = connection = con; this._createRoom(tracks); this.isDesktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled(); diff --git a/index.html b/index.html index 681a34429..47f73cca2 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,10 @@ - + diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index e20275b47..f40d2e9be 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -141,8 +141,10 @@ SmallVideo.createStreamElement = function (stream) { element.id = SmallVideo.getStreamElementID(stream); element.onplay = function () { + var now = APP.performanceTimes["video.render"] + = window.performance.now(); console.log("(TIME) Render " + (isVideo ? 'video' : 'audio') + ":\t", - window.performance.now()); + now); }; element.oncontextmenu = function () { return false; };