Selaa lähdekoodia

Fixes the performance time structure which is used by torture

dev1
hristoterezov 9 vuotta sitten
vanhempi
commit
d2c277eec3

+ 1
- 1
modules/xmpp/ChatRoom.js Näytä tiedosto

@@ -266,7 +266,7 @@ ChatRoom.prototype.onPresence = function (pres) {
266 266
             this.joined = true;
267 267
             var now = this.performanceTimes["muc.joined"] =
268 268
                 window.performance.now();
269
-            console.log("(TIME) MUC joined:\t", now);
269
+            logger.log("(TIME) MUC joined:\t", now);
270 270
             this.eventEmitter.emit(XMPPEvents.MUC_JOINED);
271 271
         }
272 272
     } else if (this.members[from] === undefined) {

+ 2
- 4
modules/xmpp/JingleSessionPC.js Näytä tiedosto

@@ -152,11 +152,9 @@ JingleSessionPC.prototype.doInitialize = function () {
152 152
      */
153 153
     this.peerconnection.oniceconnectionstatechange = function (event) {
154 154
         if (!(self && self.peerconnection)) return;
155
-        self.room.performanceTimes["ice.state"] =
156
-            self.room.performanceTimes["ice.state"] || [];
157 155
         var now = window.performance.now();
158
-        self.room.performanceTimes["ice.state"].push(
159
-            {state: self.peerconnection.iceConnectionState, time: now});
156
+        self.room.performanceTimes["ice.state." +
157
+            self.peerconnection.iceConnectionState] = now;
160 158
         logger.log("(TIME) ICE " + self.peerconnection.iceConnectionState +
161 159
                     ":\t", now);
162 160
         self.updateModifySourcesQueue();

+ 1
- 1
modules/xmpp/strophe.jingle.js Näytä tiedosto

@@ -95,7 +95,7 @@ module.exports = function(XMPP, eventEmitter) {
95 95
             switch (action) {
96 96
                 case 'session-initiate':
97 97
                     var now = window.performance.now();
98
-                    console.log("(TIME) received session-initiate:\t", now);
98
+                    logger.log("(TIME) received session-initiate:\t", now);
99 99
                     var startMuted = $(iq).find('jingle>startmuted');
100 100
                     if (startMuted && startMuted.length > 0) {
101 101
                         var audioMuted = startMuted.attr("audio");

+ 2
- 4
modules/xmpp/xmpp.js Näytä tiedosto

@@ -37,7 +37,7 @@ function XMPP(options, token) {
37 37
     this.eventEmitter = new EventEmitter();
38 38
     this.connection = null;
39 39
     this.disconnectInProgress = false;
40
-    this.performanceTimes = {status: []};
40
+    this.performanceTimes = {};
41 41
     this.forceMuted = false;
42 42
     this.options = options;
43 43
     initStrophePlugins(this);
@@ -62,9 +62,7 @@ XMPP.prototype.getConnection = function () { return this.connection; };
62 62
  */
63 63
 XMPP.prototype.connectionHandler = function (password, status, msg) {
64 64
     var now = window.performance.now();
65
-    this.performanceTimes["status"].push(
66
-        {state: Strophe.getStatusString(status),
67
-        time: now});
65
+    this.performanceTimes[Strophe.getStatusString(status).toLowerCase()] = now;
68 66
     logger.log("(TIME) Strophe " + Strophe.getStatusString(status) +
69 67
         (msg ? "[" + msg + "]" : "") + ":\t", now);
70 68
     if (status === Strophe.Status.CONNECTED ||

Loading…
Peruuta
Tallenna