Browse Source

Sends additional logs to callstats.

Logs versions of components and library version. Logs shard and region if available.
dev1
damencho 9 years ago
parent
commit
d773e0bcff

+ 15
- 0
JitsiConference.js View File

@@ -75,6 +75,21 @@ function JitsiConference(options) {
75 75
         video: undefined
76 76
     };
77 77
     this.isMutedByFocus = false;
78
+
79
+    // Lets send some general stats useful for debuging problems
80
+    var log = "";
81
+    if(window.jitsiProxyRegion)
82
+        log += "ProxyRegion:" + window.jitsiProxyRegion;
83
+    if(window.jitsiRegion)
84
+        log += (log.length > 0? ", " : "") + "Region: " + window.jitsiRegion;
85
+    if(window.jitsiShard)
86
+        log += (log.length > 0? ", " : "") + "Shard: " + window.jitsiShard;
87
+
88
+    if (log.length > 0)
89
+        Statistics.sendLog(log);
90
+
91
+    if(JitsiMeetJS.version)
92
+        Statistics.sendLog("LibJitsiMeet:" + JitsiMeetJS.version);
78 93
 }
79 94
 
80 95
 /**

+ 7
- 0
connection_optimization/external_connect.js View File

@@ -39,6 +39,13 @@ function createConnectionExternally(webserviceUrl, success_callback,
39 39
             if (xhttp.status == HTTP_STATUS_OK) {
40 40
                 try {
41 41
                     var data = JSON.parse(xhttp.responseText);
42
+                    var headers = xhttp.getAllResponseHeaders();
43
+                    window.jitsiProxyRegion
44
+                        = xhttp.getResponseHeader('X-Proxy-Region');
45
+                    window.jitsiRegion
46
+                        = xhttp.getResponseHeader('X-Jitsi-Region');
47
+                    window.jitsiShard
48
+                        = xhttp.getResponseHeader('X-Jitsi-Shard');
42 49
                     success_callback(data);
43 50
                 } catch (e) {
44 51
                     error_callback(e);

+ 11
- 1
modules/statistics/statistics.js View File

@@ -92,7 +92,7 @@ Statistics.prototype.startRemoteStats = function (peerconnection) {
92 92
 
93 93
     try {
94 94
         this.rtpStats
95
-            = new RTPStats(peerconnection, 
95
+            = new RTPStats(peerconnection,
96 96
                     this.audioLevelsInterval, 2000, this.eventEmitter);
97 97
         this.rtpStats.start();
98 98
     } catch (e) {
@@ -368,6 +368,16 @@ Statistics.sendUnhandledError = function (e) {
368 368
     CallStats.sendUnhandledError(e, null);
369 369
 };
370 370
 
371
+/**
372
+ * Adds to CallStats an application log.
373
+ *
374
+ * @param {String} a log message to send
375
+ */
376
+Statistics.sendLog = function (m) {
377
+    // uses  the same field for cs stat as unhandled error
378
+    CallStats.sendUnhandledError(m, null);
379
+};
380
+
371 381
 /**
372 382
  * Sends the given feedback through CallStats.
373 383
  *

+ 9
- 0
modules/version/ComponentsVersions.js View File

@@ -1,4 +1,5 @@
1 1
 var logger = require("jitsi-meet-logger").getLogger(__filename);
2
+var Statistics = require("../statistics/statistics");
2 3
 
3 4
 /**
4 5
  * The constant for the name of the focus component.
@@ -46,6 +47,7 @@ function(node, mucResource, mucJid) {
46 47
         return;
47 48
     }
48 49
 
50
+    var log = "";
49 51
     node.children.forEach(function(item){
50 52
 
51 53
         var componentName = item.attributes.name;
@@ -62,8 +64,15 @@ function(node, mucResource, mucJid) {
62 64
         if (this.versions[componentName] !== version) {
63 65
             this.versions[componentName] = version;
64 66
             logger.info("Got " + componentName + " version: " + version);
67
+
68
+            log += (log.length > 0? ", " : "")
69
+                + componentName + ": " + version;
65 70
         }
66 71
     }.bind(this));
72
+
73
+    // logs versions to stats
74
+    if (log.length > 0)
75
+        Statistics.sendLog(log);
67 76
 };
68 77
 
69 78
 /**

Loading…
Cancel
Save