Просмотр исходного кода

Merge pull request #769 from jitsi/ttfm

Adds analytics event and console log for TTFM (time to first media).
j8
Paweł Domas 9 лет назад
Родитель
Сommit
c7710bfe1c
2 измененных файлов: 17 добавлений и 0 удалений
  1. 6
    0
      conference.js
  2. 11
    0
      modules/UI/videolayout/SmallVideo.js

+ 6
- 0
conference.js Просмотреть файл

628
     sendFeedback (overallFeedback, detailedFeedback) {
628
     sendFeedback (overallFeedback, detailedFeedback) {
629
         return room.sendFeedback (overallFeedback, detailedFeedback);
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
     // used by torture currently
637
     // used by torture currently
632
     isJoined () {
638
     isJoined () {
633
         return this._room
639
         return this._room

+ 11
- 0
modules/UI/videolayout/SmallVideo.js Просмотреть файл

167
         console.log("(TIME) Render " + type + ":\t",
167
         console.log("(TIME) Render " + type + ":\t",
168
                     now);
168
                     now);
169
         AnalyticsAdapter.sendEvent('render.' + type, now);
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
     return element;
182
     return element;
172
 };
183
 };

Загрузка…
Отмена
Сохранить