Browse Source

Stores measured times and exposes them

master
hristoterezov 9 years ago
parent
commit
8d77088f6d
4 changed files with 18 additions and 6 deletions
  1. 10
    3
      app.js
  2. 1
    1
      conference.js
  3. 4
    1
      index.html
  4. 3
    1
      modules/UI/videolayout/SmallVideo.js

+ 10
- 3
app.js View File

51
         status: "initialized",
51
         status: "initialized",
52
         handler: null
52
         handler: null
53
     },
53
     },
54
+    // Used for automated performance tests
55
+    performanceTimes: {
56
+        "index.loaded": window.indexLoadedTime
57
+    },
54
     UI,
58
     UI,
55
     settings,
59
     settings,
56
     conference,
60
     conference,
61
+    connection: null,
57
     API,
62
     API,
58
     init () {
63
     init () {
59
         this.keyboardshortcut =
64
         this.keyboardshortcut =
98
             // Get config result callback
103
             // Get config result callback
99
             function(success, error) {
104
             function(success, error) {
100
                 if (success) {
105
                 if (success) {
101
-                    console.log("(TIME) configuration fetched:\t",
102
-                                window.performance.now());
106
+                    var now = APP.performanceTimes["configuration.fetched"] =
107
+                        window.performance.now();
108
+                    console.log("(TIME) configuration fetched:\t", now);
103
                     init();
109
                     init();
104
                 } else {
110
                 } else {
105
                     // Show obtain config error,
111
                     // Show obtain config error,
118
 
124
 
119
 
125
 
120
 $(document).ready(function () {
126
 $(document).ready(function () {
121
-    console.log("(TIME) document ready:\t", window.performance.now());
127
+    var now = APP.performanceTimes["document.ready"] = window.performance.now();
128
+    console.log("(TIME) document ready:\t", now);
122
 
129
 
123
     URLProcessor.setConfigParametersFromUrl();
130
     URLProcessor.setConfigParametersFromUrl();
124
     APP.init();
131
     APP.init();

+ 1
- 1
conference.js View File

328
             ]);
328
             ]);
329
         }).then(([tracks, con]) => {
329
         }).then(([tracks, con]) => {
330
             console.log('initialized with %s local tracks', tracks.length);
330
             console.log('initialized with %s local tracks', tracks.length);
331
-            connection = con;
331
+            APP.connection = connection = con;
332
             this._createRoom(tracks);
332
             this._createRoom(tracks);
333
             this.isDesktopSharingEnabled =
333
             this.isDesktopSharingEnabled =
334
                 JitsiMeetJS.isDesktopSharingEnabled();
334
                 JitsiMeetJS.isDesktopSharingEnabled();

+ 4
- 1
index.html View File

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

+ 3
- 1
modules/UI/videolayout/SmallVideo.js View File

141
     element.id = SmallVideo.getStreamElementID(stream);
141
     element.id = SmallVideo.getStreamElementID(stream);
142
 
142
 
143
     element.onplay = function () {
143
     element.onplay = function () {
144
+        var now = APP.performanceTimes["video.render"]
145
+            = window.performance.now();
144
         console.log("(TIME) Render " + (isVideo ? 'video' : 'audio') + ":\t",
146
         console.log("(TIME) Render " + (isVideo ? 'video' : 'audio') + ":\t",
145
-                    window.performance.now());
147
+                    now);
146
     };
148
     };
147
 
149
 
148
     element.oncontextmenu = function () { return false; };
150
     element.oncontextmenu = function () { return false; };

Loading…
Cancel
Save