소스 검색

Stores measured times and exposes them

j8
hristoterezov 9 년 전
부모
커밋
8d77088f6d
4개의 변경된 파일18개의 추가작업 그리고 6개의 파일을 삭제
  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 파일 보기

@@ -51,9 +51,14 @@ const APP = {
51 51
         status: "initialized",
52 52
         handler: null
53 53
     },
54
+    // Used for automated performance tests
55
+    performanceTimes: {
56
+        "index.loaded": window.indexLoadedTime
57
+    },
54 58
     UI,
55 59
     settings,
56 60
     conference,
61
+    connection: null,
57 62
     API,
58 63
     init () {
59 64
         this.keyboardshortcut =
@@ -98,8 +103,9 @@ function obtainConfigAndInit() {
98 103
             // Get config result callback
99 104
             function(success, error) {
100 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 109
                     init();
104 110
                 } else {
105 111
                     // Show obtain config error,
@@ -118,7 +124,8 @@ function obtainConfigAndInit() {
118 124
 
119 125
 
120 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 130
     URLProcessor.setConfigParametersFromUrl();
124 131
     APP.init();

+ 1
- 1
conference.js 파일 보기

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

+ 4
- 1
index.html 파일 보기

@@ -1,7 +1,10 @@
1 1
 <html itemscope itemtype="http://schema.org/Product" prefix="og: http://ogp.me/ns#" xmlns="http://www.w3.org/1999/html">
2 2
   <head>
3 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 8
     <script src="config.js?v=15"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
6 9
     <script src="utils.js?v=1"></script>
7 10
     <!--#include virtual="connection_optimization/connection_optimization.html" -->

+ 3
- 1
modules/UI/videolayout/SmallVideo.js 파일 보기

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

Loading…
취소
저장