ソースを参照

Merge pull request #1169 from jitsi/page_reload_reason

Log more details on page reload
j8
Дамян Минков 8年前
コミット
9f26270a98
3個のファイルの変更18行の追加9行の削除
  1. 8
    5
      conference.js
  2. 5
    2
      modules/UI/UI.js
  3. 5
    2
      modules/UI/reload_overlay/PageReloadOverlay.js

+ 8
- 5
conference.js ファイルの表示

387
             // the app. Both the errors above are unrecoverable from the library
387
             // the app. Both the errors above are unrecoverable from the library
388
             // perspective.
388
             // perspective.
389
             room.leave().then(() => connection.disconnect());
389
             room.leave().then(() => connection.disconnect());
390
-            APP.UI.showPageReloadOverlay();
390
+            APP.UI.showPageReloadOverlay(err);
391
             break;
391
             break;
392
 
392
 
393
         case ConferenceErrors.CONFERENCE_MAX_USERS:
393
         case ConferenceErrors.CONFERENCE_MAX_USERS:
550
                 // - connection dropped(closed by Strophe unexpectedly
550
                 // - connection dropped(closed by Strophe unexpectedly
551
                 //   possible due too many transport errors)
551
                 //   possible due too many transport errors)
552
                 logger.error("XMPP connection error: " + errMsg);
552
                 logger.error("XMPP connection error: " + errMsg);
553
-                APP.UI.showPageReloadOverlay();
553
+                APP.UI.showPageReloadOverlay(
554
+                    "xmpp-conn-dropped:" + errMsg);
554
                 connection.removeEventListener(
555
                 connection.removeEventListener(
555
                     ConnectionEvents.CONNECTION_FAILED, handler);
556
                     ConnectionEvents.CONNECTION_FAILED, handler);
556
                 // FIXME it feels like the conference should be stopped
557
                 // FIXME it feels like the conference should be stopped
1736
      * @param {string} name the event name
1737
      * @param {string} name the event name
1737
      * @param {int} value the value (it's int because google analytics supports
1738
      * @param {int} value the value (it's int because google analytics supports
1738
      * only int).
1739
      * only int).
1740
+     * @param {string} label short text which provides more info about the event
1741
+     * which allows to distinguish between few event cases of the same name
1739
      * NOTE: Should be used after conference.init
1742
      * NOTE: Should be used after conference.init
1740
      */
1743
      */
1741
-    logEvent(name, value) {
1744
+    logEvent(name, value, label) {
1742
         if(JitsiMeetJS.analytics) {
1745
         if(JitsiMeetJS.analytics) {
1743
-            JitsiMeetJS.analytics.sendEvent(name, {value});
1746
+            JitsiMeetJS.analytics.sendEvent(name, {value, label});
1744
         }
1747
         }
1745
         if(room) {
1748
         if(room) {
1746
-            room.sendApplicationLog(JSON.stringify({name, value}));
1749
+            room.sendApplicationLog(JSON.stringify({name, value, label}));
1747
         }
1750
         }
1748
     },
1751
     },
1749
     /**
1752
     /**

+ 5
- 2
modules/UI/UI.js ファイルの表示

1092
 /**
1092
 /**
1093
  * Notify the user that the video conferencing service is badly broken and
1093
  * Notify the user that the video conferencing service is badly broken and
1094
  * the page should be reloaded.
1094
  * the page should be reloaded.
1095
+ *
1096
+ * @param {string} a label string identifying the reason for the page reload
1097
+ * which will be included in details of the log event.
1095
  */
1098
  */
1096
-UI.showPageReloadOverlay = function () {
1099
+UI.showPageReloadOverlay = function (reason) {
1097
     // Reload the page after 10 - 30 seconds
1100
     // Reload the page after 10 - 30 seconds
1098
-    PageReloadOverlay.show(10 + RandomUtil.randomInt(0, 20));
1101
+    PageReloadOverlay.show(10 + RandomUtil.randomInt(0, 20), reason);
1099
 };
1102
 };
1100
 
1103
 
1101
 /**
1104
 /**

+ 5
- 2
modules/UI/reload_overlay/PageReloadOverlay.js ファイルの表示

113
      *
113
      *
114
      * @param {number} timeoutSeconds how many seconds before the conference
114
      * @param {number} timeoutSeconds how many seconds before the conference
115
      * reload will happen.
115
      * reload will happen.
116
+     * @param {string} reason a label string identifying the reason for the page
117
+     * reload which will be included in details of the log event
116
      */
118
      */
117
-    show(timeoutSeconds) {
119
+    show(timeoutSeconds, reason) {
118
 
120
 
119
         if (!overlay) {
121
         if (!overlay) {
120
             overlay = new PageReloadOverlayImpl(timeoutSeconds);
122
             overlay = new PageReloadOverlayImpl(timeoutSeconds);
124
             // FIXME (CallStats - issue) this event will not make it to
126
             // FIXME (CallStats - issue) this event will not make it to
125
             // the CallStats, because the log queue is not flushed, before
127
             // the CallStats, because the log queue is not flushed, before
126
             // "fabric terminated" is sent to the backed
128
             // "fabric terminated" is sent to the backed
127
-            APP.conference.logEvent('page.reload');
129
+            APP.conference.logEvent(
130
+                'page.reload', undefined /* value */, reason /* label */);
128
         }
131
         }
129
         overlay.show();
132
         overlay.show();
130
     }
133
     }

読み込み中…
キャンセル
保存