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
         video: undefined
75
         video: undefined
76
     };
76
     };
77
     this.isMutedByFocus = false;
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
             if (xhttp.status == HTTP_STATUS_OK) {
39
             if (xhttp.status == HTTP_STATUS_OK) {
40
                 try {
40
                 try {
41
                     var data = JSON.parse(xhttp.responseText);
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
                     success_callback(data);
49
                     success_callback(data);
43
                 } catch (e) {
50
                 } catch (e) {
44
                     error_callback(e);
51
                     error_callback(e);

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

92
 
92
 
93
     try {
93
     try {
94
         this.rtpStats
94
         this.rtpStats
95
-            = new RTPStats(peerconnection, 
95
+            = new RTPStats(peerconnection,
96
                     this.audioLevelsInterval, 2000, this.eventEmitter);
96
                     this.audioLevelsInterval, 2000, this.eventEmitter);
97
         this.rtpStats.start();
97
         this.rtpStats.start();
98
     } catch (e) {
98
     } catch (e) {
368
     CallStats.sendUnhandledError(e, null);
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
  * Sends the given feedback through CallStats.
382
  * Sends the given feedback through CallStats.
373
  *
383
  *

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

1
 var logger = require("jitsi-meet-logger").getLogger(__filename);
1
 var logger = require("jitsi-meet-logger").getLogger(__filename);
2
+var Statistics = require("../statistics/statistics");
2
 
3
 
3
 /**
4
 /**
4
  * The constant for the name of the focus component.
5
  * The constant for the name of the focus component.
46
         return;
47
         return;
47
     }
48
     }
48
 
49
 
50
+    var log = "";
49
     node.children.forEach(function(item){
51
     node.children.forEach(function(item){
50
 
52
 
51
         var componentName = item.attributes.name;
53
         var componentName = item.attributes.name;
62
         if (this.versions[componentName] !== version) {
64
         if (this.versions[componentName] !== version) {
63
             this.versions[componentName] = version;
65
             this.versions[componentName] = version;
64
             logger.info("Got " + componentName + " version: " + version);
66
             logger.info("Got " + componentName + " version: " + version);
67
+
68
+            log += (log.length > 0? ", " : "")
69
+                + componentName + ": " + version;
65
         }
70
         }
66
     }.bind(this));
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