Quellcode durchsuchen

Filters some statistics from the logs. Increases the interval for logged statistics.

j8
Boris Grozev vor 10 Jahren
Ursprung
Commit
806d4ea443
2 geänderte Dateien mit 82 neuen und 19 gelöschten Zeilen
  1. 41
    9
      libs/app.bundle.js
  2. 41
    10
      modules/statistics/RTPStatsCollector.js

+ 41
- 9
libs/app.bundle.js Datei anzeigen

@@ -10910,7 +10910,7 @@ function StatsCollector(peerconnection, audioLevelsInterval, statsInterval, even
10910 10910
     /**
10911 10911
      * Gather PeerConnection stats once every this many milliseconds.
10912 10912
      */
10913
-    this.GATHER_INTERVAL = 10000;
10913
+    this.GATHER_INTERVAL = 15000;
10914 10914
 
10915 10915
     /**
10916 10916
      * Log stats via the focus once every this many milliseconds.
@@ -11075,6 +11075,38 @@ StatsCollector.prototype.start = function ()
11075 11075
     }
11076 11076
 };
11077 11077
 
11078
+/**
11079
+ * Checks whether a certain record should be included in the logged statistics.
11080
+ */
11081
+function acceptStat(reportId, reportType, statName) {
11082
+    if (reportType == "googCandidatePair" && statName == "googChannelId")
11083
+        return false;
11084
+
11085
+    if (reportType == "ssrc") {
11086
+        if (statName == "googTrackId" ||
11087
+            statName == "transportId" ||
11088
+            statName == "ssrc")
11089
+            return false;
11090
+    }
11091
+
11092
+    return true;
11093
+}
11094
+
11095
+/**
11096
+ * Checks whether a certain record should be included in the logged statistics.
11097
+ */
11098
+function acceptReport(id, type) {
11099
+    if (id.substring(0, 15) == "googCertificate" ||
11100
+        id.substring(0, 9) == "googTrack" ||
11101
+        id.substring(0, 20) == "googLibjingleSession")
11102
+        return false;
11103
+
11104
+    if (type == "goodComponent")
11105
+        return false;
11106
+
11107
+    return true;
11108
+}
11109
+
11078 11110
 /**
11079 11111
  * Converts the stats to the format used for logging, and saves the data in
11080 11112
  * this.statsToBeLogged.
@@ -11085,12 +11117,16 @@ StatsCollector.prototype.addStatsToBeLogged = function (reports) {
11085 11117
     var num_records = this.statsToBeLogged.timestamps.length;
11086 11118
     this.statsToBeLogged.timestamps.push(new Date().getTime());
11087 11119
     reports.map(function (report) {
11120
+        if (!acceptReport(report.id, report.type))
11121
+            return;
11088 11122
         var stat = self.statsToBeLogged.stats[report.id];
11089 11123
         if (!stat) {
11090 11124
             stat = self.statsToBeLogged.stats[report.id] = {};
11091 11125
         }
11092 11126
         stat.type = report.type;
11093 11127
         report.names().map(function (name) {
11128
+            if (!acceptStat(report.id, report.type, name))
11129
+                return;
11094 11130
             var values = stat[name];
11095 11131
             if (!values) {
11096 11132
                 values = stat[name] = [];
@@ -11452,21 +11488,17 @@ StatsCollector.prototype.processAudioLevelReport = function ()
11452 11488
         {
11453 11489
             // TODO: can't find specs about what this value really is,
11454 11490
             // but it seems to vary between 0 and around 32k.
11455
-            audioLevel = formatAudioLevel(audioLevel / 32767);
11456
-            var oldLevel = jidStats.ssrc2AudioLevel[ssrc];
11457
-            if(jid != APP.xmpp.myJid() && (!oldLevel || oldLevel != audioLevel))
11458
-            {
11459
-
11460
-                jidStats.ssrc2AudioLevel[ssrc] = audioLevel;
11461
-
11491
+            audioLevel = audioLevel / 32767;
11492
+            jidStats.setSsrcAudioLevel(ssrc, audioLevel);
11493
+            if(jid != APP.xmpp.myJid())
11462 11494
                 this.eventEmitter.emit("statistics.audioLevel", jid, audioLevel);
11463
-            }
11464 11495
         }
11465 11496
 
11466 11497
     }
11467 11498
 
11468 11499
 
11469 11500
 };
11501
+
11470 11502
 },{"../../service/RTC/RTCBrowserType":79}],45:[function(require,module,exports){
11471 11503
 /**
11472 11504
  * Created by hristo on 8/4/14.

+ 41
- 10
modules/statistics/RTPStatsCollector.js Datei anzeigen

@@ -151,7 +151,7 @@ function StatsCollector(peerconnection, audioLevelsInterval, statsInterval, even
151 151
     /**
152 152
      * Gather PeerConnection stats once every this many milliseconds.
153 153
      */
154
-    this.GATHER_INTERVAL = 10000;
154
+    this.GATHER_INTERVAL = 15000;
155 155
 
156 156
     /**
157 157
      * Log stats via the focus once every this many milliseconds.
@@ -316,6 +316,38 @@ StatsCollector.prototype.start = function ()
316 316
     }
317 317
 };
318 318
 
319
+/**
320
+ * Checks whether a certain record should be included in the logged statistics.
321
+ */
322
+function acceptStat(reportId, reportType, statName) {
323
+    if (reportType == "googCandidatePair" && statName == "googChannelId")
324
+        return false;
325
+
326
+    if (reportType == "ssrc") {
327
+        if (statName == "googTrackId" ||
328
+            statName == "transportId" ||
329
+            statName == "ssrc")
330
+            return false;
331
+    }
332
+
333
+    return true;
334
+}
335
+
336
+/**
337
+ * Checks whether a certain record should be included in the logged statistics.
338
+ */
339
+function acceptReport(id, type) {
340
+    if (id.substring(0, 15) == "googCertificate" ||
341
+        id.substring(0, 9) == "googTrack" ||
342
+        id.substring(0, 20) == "googLibjingleSession")
343
+        return false;
344
+
345
+    if (type == "goodComponent")
346
+        return false;
347
+
348
+    return true;
349
+}
350
+
319 351
 /**
320 352
  * Converts the stats to the format used for logging, and saves the data in
321 353
  * this.statsToBeLogged.
@@ -326,12 +358,16 @@ StatsCollector.prototype.addStatsToBeLogged = function (reports) {
326 358
     var num_records = this.statsToBeLogged.timestamps.length;
327 359
     this.statsToBeLogged.timestamps.push(new Date().getTime());
328 360
     reports.map(function (report) {
361
+        if (!acceptReport(report.id, report.type))
362
+            return;
329 363
         var stat = self.statsToBeLogged.stats[report.id];
330 364
         if (!stat) {
331 365
             stat = self.statsToBeLogged.stats[report.id] = {};
332 366
         }
333 367
         stat.type = report.type;
334 368
         report.names().map(function (name) {
369
+            if (!acceptStat(report.id, report.type, name))
370
+                return;
335 371
             var values = stat[name];
336 372
             if (!values) {
337 373
                 values = stat[name] = [];
@@ -693,18 +729,13 @@ StatsCollector.prototype.processAudioLevelReport = function ()
693 729
         {
694 730
             // TODO: can't find specs about what this value really is,
695 731
             // but it seems to vary between 0 and around 32k.
696
-            audioLevel = formatAudioLevel(audioLevel / 32767);
697
-            var oldLevel = jidStats.ssrc2AudioLevel[ssrc];
698
-            if(jid != APP.xmpp.myJid() && (!oldLevel || oldLevel != audioLevel))
699
-            {
700
-
701
-                jidStats.ssrc2AudioLevel[ssrc] = audioLevel;
702
-
732
+            audioLevel = audioLevel / 32767;
733
+            jidStats.setSsrcAudioLevel(ssrc, audioLevel);
734
+            if(jid != APP.xmpp.myJid())
703 735
                 this.eventEmitter.emit("statistics.audioLevel", jid, audioLevel);
704
-            }
705 736
         }
706 737
 
707 738
     }
708 739
 
709 740
 
710
-};
741
+};

Laden…
Abbrechen
Speichern