Merge pull request #580 from jitsi/performance_torture

Stores measured times and exposes them
This commit is contained in:
damencho 2016-04-01 15:43:33 -05:00
commit 2d1e7c9baf
4 changed files with 18 additions and 6 deletions

13
app.js
View File

@ -51,9 +51,14 @@ const APP = {
status: "initialized", status: "initialized",
handler: null handler: null
}, },
// Used for automated performance tests
performanceTimes: {
"index.loaded": window.indexLoadedTime
},
UI, UI,
settings, settings,
conference, conference,
connection: null,
API, API,
init () { init () {
this.keyboardshortcut = this.keyboardshortcut =
@ -98,8 +103,9 @@ function obtainConfigAndInit() {
// Get config result callback // Get config result callback
function(success, error) { function(success, error) {
if (success) { if (success) {
console.log("(TIME) configuration fetched:\t", var now = APP.performanceTimes["configuration.fetched"] =
window.performance.now()); window.performance.now();
console.log("(TIME) configuration fetched:\t", now);
init(); init();
} else { } else {
// Show obtain config error, // Show obtain config error,
@ -118,7 +124,8 @@ function obtainConfigAndInit() {
$(document).ready(function () { $(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(); URLProcessor.setConfigParametersFromUrl();
APP.init(); APP.init();

View File

@ -328,7 +328,7 @@ export default {
]); ]);
}).then(([tracks, con]) => { }).then(([tracks, con]) => {
console.log('initialized with %s local tracks', tracks.length); console.log('initialized with %s local tracks', tracks.length);
connection = con; APP.connection = connection = con;
this._createRoom(tracks); this._createRoom(tracks);
this.isDesktopSharingEnabled = this.isDesktopSharingEnabled =
JitsiMeetJS.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"> <html itemscope itemtype="http://schema.org/Product" prefix="og: http://ogp.me/ns#" xmlns="http://www.w3.org/1999/html">
<head> <head>
<!--#include virtual="title.html" --> <!--#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="config.js?v=15"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
<script src="utils.js?v=1"></script> <script src="utils.js?v=1"></script>
<!--#include virtual="connection_optimization/connection_optimization.html" --> <!--#include virtual="connection_optimization/connection_optimization.html" -->

View File

@ -141,8 +141,10 @@ SmallVideo.createStreamElement = function (stream) {
element.id = SmallVideo.getStreamElementID(stream); element.id = SmallVideo.getStreamElementID(stream);
element.onplay = function () { element.onplay = function () {
var now = APP.performanceTimes["video.render"]
= window.performance.now();
console.log("(TIME) Render " + (isVideo ? 'video' : 'audio') + ":\t", console.log("(TIME) Render " + (isVideo ? 'video' : 'audio') + ":\t",
window.performance.now()); now);
}; };
element.oncontextmenu = function () { return false; }; element.oncontextmenu = function () { return false; };