Bladeren bron

Merge pull request #68 from jitsi/performanceTime_format

Fixes the performance time structure which is used by torture
master
damencho 9 jaren geleden
bovenliggende
commit
254f4f400c

+ 4
- 4
JitsiConference.js Bestand weergeven

845
 };
845
 };
846
 
846
 
847
 /**
847
 /**
848
- * Returns measured performanceTimes.
848
+ * Returns measured connectionTimes.
849
  */
849
  */
850
-JitsiConference.prototype.getPerformanceTimes = function () {
851
-    return this.room.performanceTimes;
850
+JitsiConference.prototype.getConnectionTimes = function () {
851
+    return this.room.connectionTimes;
852
 };
852
 };
853
 
853
 
854
 /**
854
 /**
885
         if (conference.room.isFocus(jingleSession.peerjid)) {
885
         if (conference.room.isFocus(jingleSession.peerjid)) {
886
             // Accept incoming call
886
             // Accept incoming call
887
             conference.room.setJingleSession(jingleSession);
887
             conference.room.setJingleSession(jingleSession);
888
-            conference.room.performanceTimes["session.initiate"] = now;
888
+            conference.room.connectionTimes["session.initiate"] = now;
889
             jingleSession.initialize(false /* initiator */, conference.room);
889
             jingleSession.initialize(false /* initiator */, conference.room);
890
             conference.rtc.onIncommingCall(jingleSession);
890
             conference.rtc.onIncommingCall(jingleSession);
891
             jingleSession.acceptOffer(jingleOffer, null,
891
             jingleSession.acceptOffer(jingleOffer, null,

+ 3
- 3
JitsiConnection.js Bestand weergeven

94
 }
94
 }
95
 
95
 
96
 /**
96
 /**
97
- * Returns measured performanceTimes.
97
+ * Returns measured connectionTimes.
98
  */
98
  */
99
-JitsiConnection.prototype.getPerformanceTimes = function () {
100
-    return this.xmpp.performanceTimes;
99
+JitsiConnection.prototype.getConnectionTimes = function () {
100
+    return this.xmpp.connectionTimes;
101
 };
101
 };
102
 
102
 
103
 module.exports = JitsiConnection;
103
 module.exports = JitsiConnection;

+ 3
- 3
connection_optimization/external_connect.js Bestand weergeven

33
 
33
 
34
     xhttp.onreadystatechange = function() {
34
     xhttp.onreadystatechange = function() {
35
         if (xhttp.readyState == xhttp.DONE) {
35
         if (xhttp.readyState == xhttp.DONE) {
36
-            var now = window.performanceTimes["external_connect.done"] =
36
+            var now = window.connectionTimes["external_connect.done"] =
37
                 window.performance.now();
37
                 window.performance.now();
38
             console.log("(TIME) external connect XHR done:\t", now);
38
             console.log("(TIME) external connect XHR done:\t", now);
39
             if (xhttp.status == HTTP_STATUS_OK) {
39
             if (xhttp.status == HTTP_STATUS_OK) {
53
     xhttp.timeout = 3000;
53
     xhttp.timeout = 3000;
54
 
54
 
55
     xhttp.open("GET", webserviceUrl, true);
55
     xhttp.open("GET", webserviceUrl, true);
56
-    window.performanceTimes = {};
57
-    var now = window.performanceTimes["external_connect.sending"] =
56
+    window.connectionTimes = {};
57
+    var now = window.connectionTimes["external_connect.sending"] =
58
         window.performance.now();
58
         window.performance.now();
59
     console.log("(TIME) Sending external connect XHR:\t", now);
59
     console.log("(TIME) Sending external connect XHR:\t", now);
60
     xhttp.send();
60
     xhttp.send();

+ 3
- 3
modules/xmpp/ChatRoom.js Bestand weergeven

83
     this.lastPresences = {};
83
     this.lastPresences = {};
84
     this.phoneNumber = null;
84
     this.phoneNumber = null;
85
     this.phonePin = null;
85
     this.phonePin = null;
86
-    this.performanceTimes = {};
86
+    this.connectionTimes = {};
87
 }
87
 }
88
 
88
 
89
 ChatRoom.prototype.initPresenceMap = function () {
89
 ChatRoom.prototype.initPresenceMap = function () {
264
         }
264
         }
265
         if (!this.joined) {
265
         if (!this.joined) {
266
             this.joined = true;
266
             this.joined = true;
267
-            var now = this.performanceTimes["muc.joined"] =
267
+            var now = this.connectionTimes["muc.joined"] =
268
                 window.performance.now();
268
                 window.performance.now();
269
-            console.log("(TIME) MUC joined:\t", now);
269
+            logger.log("(TIME) MUC joined:\t", now);
270
             this.eventEmitter.emit(XMPPEvents.MUC_JOINED);
270
             this.eventEmitter.emit(XMPPEvents.MUC_JOINED);
271
         }
271
         }
272
     } else if (this.members[from] === undefined) {
272
     } else if (this.members[from] === undefined) {

+ 2
- 4
modules/xmpp/JingleSessionPC.js Bestand weergeven

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

+ 1
- 1
modules/xmpp/strophe.jingle.js Bestand weergeven

95
             switch (action) {
95
             switch (action) {
96
                 case 'session-initiate':
96
                 case 'session-initiate':
97
                     var now = window.performance.now();
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
                     var startMuted = $(iq).find('jingle>startmuted');
99
                     var startMuted = $(iq).find('jingle>startmuted');
100
                     if (startMuted && startMuted.length > 0) {
100
                     if (startMuted && startMuted.length > 0) {
101
                         var audioMuted = startMuted.attr("audio");
101
                         var audioMuted = startMuted.attr("audio");

+ 3
- 5
modules/xmpp/xmpp.js Bestand weergeven

37
     this.eventEmitter = new EventEmitter();
37
     this.eventEmitter = new EventEmitter();
38
     this.connection = null;
38
     this.connection = null;
39
     this.disconnectInProgress = false;
39
     this.disconnectInProgress = false;
40
-    this.performanceTimes = {status: []};
40
+    this.connectionTimes = {};
41
     this.forceMuted = false;
41
     this.forceMuted = false;
42
     this.options = options;
42
     this.options = options;
43
     initStrophePlugins(this);
43
     initStrophePlugins(this);
62
  */
62
  */
63
 XMPP.prototype.connectionHandler = function (password, status, msg) {
63
 XMPP.prototype.connectionHandler = function (password, status, msg) {
64
     var now = window.performance.now();
64
     var now = window.performance.now();
65
-    this.performanceTimes["status"].push(
66
-        {state: Strophe.getStatusString(status),
67
-        time: now});
65
+    this.connectionTimes[Strophe.getStatusString(status).toLowerCase()] = now;
68
     logger.log("(TIME) Strophe " + Strophe.getStatusString(status) +
66
     logger.log("(TIME) Strophe " + Strophe.getStatusString(status) +
69
         (msg ? "[" + msg + "]" : "") + ":\t", now);
67
         (msg ? "[" + msg + "]" : "") + ":\t", now);
70
     if (status === Strophe.Status.CONNECTED ||
68
     if (status === Strophe.Status.CONNECTED ||
171
  * @param options {object} connecting options - rid, sid, jid and password.
169
  * @param options {object} connecting options - rid, sid, jid and password.
172
  */
170
  */
173
  XMPP.prototype.attach = function (options) {
171
  XMPP.prototype.attach = function (options) {
174
-    var now = this.performanceTimes["attaching"] = window.performance.now();
172
+    var now = this.connectionTimes["attaching"] = window.performance.now();
175
     logger.log("(TIME) Strophe Attaching\t:" + now);
173
     logger.log("(TIME) Strophe Attaching\t:" + now);
176
     this.connection.attach(options.jid, options.sid, parseInt(options.rid,10)+1,
174
     this.connection.attach(options.jid, options.sid, parseInt(options.rid,10)+1,
177
         this.connectionHandler.bind(this, options.password));
175
         this.connectionHandler.bind(this, options.password));

Laden…
Annuleren
Opslaan