Sfoglia il codice sorgente

Merge pull request #769 from jitsi/ttfm

Adds analytics event and console log for TTFM (time to first media).
j8
Paweł Domas 9 anni fa
parent
commit
c7710bfe1c
2 ha cambiato i file con 17 aggiunte e 0 eliminazioni
  1. 6
    0
      conference.js
  2. 11
    0
      modules/UI/videolayout/SmallVideo.js

+ 6
- 0
conference.js Vedi File

@@ -628,6 +628,12 @@ export default {
628 628
     sendFeedback (overallFeedback, detailedFeedback) {
629 629
         return room.sendFeedback (overallFeedback, detailedFeedback);
630 630
     },
631
+    /**
632
+     * Returns the connection times stored in the library.
633
+     */
634
+    getConnectionTimes () {
635
+        return this._room.getConnectionTimes();
636
+    },
631 637
     // used by torture currently
632 638
     isJoined () {
633 639
         return this._room

+ 11
- 0
modules/UI/videolayout/SmallVideo.js Vedi File

@@ -167,6 +167,17 @@ SmallVideo.createStreamElement = function (stream) {
167 167
         console.log("(TIME) Render " + type + ":\t",
168 168
                     now);
169 169
         AnalyticsAdapter.sendEvent('render.' + type, now);
170
+
171
+        // Time to first media, a number that can be used for comparision of
172
+        // time fot rendering media. It can be used for the first and
173
+        // the rest participants. It subtracts the period of waiting for the
174
+        // second participant to join (time between join and first
175
+        // session initiate).
176
+        var ttfm = now - APP.connectionTimes["document.ready"]
177
+            - (APP.conference.getConnectionTimes()["session.initiate"]
178
+                - APP.conference.getConnectionTimes()["muc.joined"]);
179
+        console.log("(TIME) TTFM " + type + ":\t", ttfm);
180
+        AnalyticsAdapter.sendEvent('ttfm.' + type, ttfm);
170 181
     };
171 182
     return element;
172 183
 };

Loading…
Annulla
Salva