Просмотр исходного кода

Merge pull request #68 from jitsi/performanceTime_format

Fixes the performance time structure which is used by torture
master
damencho 9 лет назад
Родитель
Сommit
254f4f400c

+ 4
- 4
JitsiConference.js Просмотреть файл

@@ -845,10 +845,10 @@ JitsiConference.prototype.getLogs = function () {
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,7 +885,7 @@ function setupListeners(conference) {
885 885
         if (conference.room.isFocus(jingleSession.peerjid)) {
886 886
             // Accept incoming call
887 887
             conference.room.setJingleSession(jingleSession);
888
-            conference.room.performanceTimes["session.initiate"] = now;
888
+            conference.room.connectionTimes["session.initiate"] = now;
889 889
             jingleSession.initialize(false /* initiator */, conference.room);
890 890
             conference.rtc.onIncommingCall(jingleSession);
891 891
             jingleSession.acceptOffer(jingleOffer, null,

+ 3
- 3
JitsiConnection.js Просмотреть файл

@@ -94,10 +94,10 @@ JitsiConnection.prototype.removeEventListener = function (event, listener) {
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 103
 module.exports = JitsiConnection;

+ 3
- 3
connection_optimization/external_connect.js Просмотреть файл

@@ -33,7 +33,7 @@ function createConnectionExternally(webserviceUrl, success_callback,
33 33
 
34 34
     xhttp.onreadystatechange = function() {
35 35
         if (xhttp.readyState == xhttp.DONE) {
36
-            var now = window.performanceTimes["external_connect.done"] =
36
+            var now = window.connectionTimes["external_connect.done"] =
37 37
                 window.performance.now();
38 38
             console.log("(TIME) external connect XHR done:\t", now);
39 39
             if (xhttp.status == HTTP_STATUS_OK) {
@@ -53,8 +53,8 @@ function createConnectionExternally(webserviceUrl, success_callback,
53 53
     xhttp.timeout = 3000;
54 54
 
55 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 58
         window.performance.now();
59 59
     console.log("(TIME) Sending external connect XHR:\t", now);
60 60
     xhttp.send();

+ 3
- 3
modules/xmpp/ChatRoom.js Просмотреть файл

@@ -83,7 +83,7 @@ function ChatRoom(connection, jid, password, XMPP, options, settings) {
83 83
     this.lastPresences = {};
84 84
     this.phoneNumber = null;
85 85
     this.phonePin = null;
86
-    this.performanceTimes = {};
86
+    this.connectionTimes = {};
87 87
 }
88 88
 
89 89
 ChatRoom.prototype.initPresenceMap = function () {
@@ -264,9 +264,9 @@ ChatRoom.prototype.onPresence = function (pres) {
264 264
         }
265 265
         if (!this.joined) {
266 266
             this.joined = true;
267
-            var now = this.performanceTimes["muc.joined"] =
267
+            var now = this.connectionTimes["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 Просмотреть файл

@@ -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.connectionTimes["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 Просмотреть файл

@@ -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");

+ 3
- 5
modules/xmpp/xmpp.js Просмотреть файл

@@ -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.connectionTimes = {};
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.connectionTimes[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 ||
@@ -171,7 +169,7 @@ XMPP.prototype._connect = function (jid, password) {
171 169
  * @param options {object} connecting options - rid, sid, jid and password.
172 170
  */
173 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 173
     logger.log("(TIME) Strophe Attaching\t:" + now);
176 174
     this.connection.attach(options.jid, options.sid, parseInt(options.rid,10)+1,
177 175
         this.connectionHandler.bind(this, options.password));

Загрузка…
Отмена
Сохранить