Sfoglia il codice sorgente

feat: Enables Octo based on a config property. Adds the bridge_count analytics property.

dev1
Boris Grozev 7 anni fa
parent
commit
4a28a19616
2 ha cambiato i file con 20 aggiunte e 12 eliminazioni
  1. 10
    12
      modules/xmpp/ChatRoom.js
  2. 10
    0
      modules/xmpp/moderator.js

+ 10
- 12
modules/xmpp/ChatRoom.js Vedi File

@@ -626,24 +626,22 @@ export default class ChatRoom extends Listenable {
626 626
 
627 627
                         const { key, value } = attributes;
628 628
 
629
+                        /* eslint-disable no-fallthrough */
629 630
                         switch (key) {
630
-                        case 'octo-enabled':
631
-                            // This flag can be used to distinguish between
632
-                            // conferences and/or participants with octo
633
-                            // enabled or disabled.
634
-                            Statistics.analytics.addPermanentProperties({
635
-                                'octo_enabled': value
636
-                            });
637
-                            break;
631
+
632
+                        // The number of jitsi-videobridge instances currently
633
+                        // used for the conference.
634
+                        case 'bridge-count':
635
+
636
+                        // The conference creation time (set by jicofo).
638 637
                         case 'created-ms':
639
-                            // The room creation time along with the JID can
640
-                            // be used to uniquely identify a
641
-                            // conference/user.
638
+                        case 'octo-enabled':
642 639
                             Statistics.analytics.addPermanentProperties({
643
-                                'created_ms': value
640
+                                [key.replace('-', '_')]: value
644 641
                             });
645 642
                             break;
646 643
                         }
644
+                        /* eslint-enable no-fallthrough */
647 645
                     }
648 646
                 }
649 647
                 break;

+ 10
- 0
modules/xmpp/moderator.js Vedi File

@@ -238,6 +238,16 @@ Moderator.prototype.createConferenceIq = function() {
238 238
                 value: config.minBitrate
239 239
             }).up();
240 240
     }
241
+    if (config.testing && config.testing.octo
242
+        && typeof config.testing.octo.probability === 'number') {
243
+        if (Math.random() < config.testing.octo.probability) {
244
+            elem.c(
245
+                'property', {
246
+                    name: 'octo',
247
+                    value: true
248
+                }).up();
249
+        }
250
+    }
241 251
 
242 252
     let openSctp;
243 253
 

Loading…
Annulla
Salva