[Spice-devel] [spice-html5 3/6] Track and make note of requests that take an unusual amount of time.

Jeremy White jwhite at codeweavers.com
Fri Jul 1 20:03:03 UTC 2016


Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
 spiceconn.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/spiceconn.js b/spiceconn.js
index 903f3b0..f20424f 100644
--- a/spiceconn.js
+++ b/spiceconn.js
@@ -334,6 +334,7 @@ SpiceConn.prototype =
     process_message: function(msg)
     {
         var rc;
+        var start = Date.now();
         DEBUG > 0 && console.log("<< hdr " + this.channel_type() + " type " + msg.type + " size " + (msg.data && msg.data.byteLength));
         rc = this.process_common_messages(msg);
         if (! rc)
@@ -361,6 +362,9 @@ SpiceConn.prototype =
             }
         }
 
+        var delta = Date.now() - start;
+        if (DEBUG > 0 || delta > GAP_DETECTION_THRESHOLD)
+            console.log("delta " + this.channel_type() + ":" + msg.type + " " + delta);
         return rc;
     },
 
-- 
2.1.4



More information about the Spice-devel mailing list