Stores measured times and exposes them

This commit is contained in:
hristoterezov 2016-04-01 14:44:25 -05:00
parent bd09fa2601
commit 8d77088f6d
4 changed files with 18 additions and 6 deletions

13
app.js
View File

@ -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();

View File

@ -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();

View File

@ -1,7 +1,10 @@
<html itemscope itemtype="http://schema.org/Product" prefix="og: http://ogp.me/ns#" xmlns="http://www.w3.org/1999/html">
<head>
<!--#include virtual="title.html" -->
<script>console.log("(TIME) index.html loaded:\t", window.performance.now());</script>
<script>
window.indexLoadedTime = window.performance.now();
console.log("(TIME) index.html loaded:\t", indexLoadedTime);
</script>
<script src="config.js?v=15"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
<script src="utils.js?v=1"></script>
<!--#include virtual="connection_optimization/connection_optimization.html" -->

View File

@ -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; };