Commit c3996e24 authored by Joel Martin's avatar Joel Martin

Round-trip timing for first full FBU.

parent d38406e6
...@@ -109,7 +109,11 @@ timing : { ...@@ -109,7 +109,11 @@ timing : {
fbu_total : 0, fbu_total : 0,
fbu_total_cnt : 0, fbu_total_cnt : 0,
full_fbu_total : 0, full_fbu_total : 0,
full_fbu_cnt : 0 full_fbu_cnt : 0,
fbu_rt_start : 0,
fbu_rt_total : 0,
fbu_rt_cnt : 0,
}, },
/* Mouse state */ /* Mouse state */
...@@ -295,6 +299,7 @@ init_msg: function () { ...@@ -295,6 +299,7 @@ init_msg: function () {
response = RFB.pixelFormat(); response = RFB.pixelFormat();
response = response.concat(RFB.encodings()); response = response.concat(RFB.encodings());
response = response.concat(RFB.fbUpdateRequest(0)); response = response.concat(RFB.fbUpdateRequest(0));
RFB.timing.fbu_rt_start = (new Date()).getTime();
RFB.send_array(response); RFB.send_array(response);
/* Start pushing/polling */ /* Start pushing/polling */
...@@ -311,7 +316,7 @@ init_msg: function () { ...@@ -311,7 +316,7 @@ init_msg: function () {
normal_msg: function () { normal_msg: function () {
//console.log(">> normal_msg"); //console.log(">> normal_msg");
var RQ = RFB.RQ, FBU = RFB.FBU, var RQ = RFB.RQ, FBU = RFB.FBU, now, fbu_rt_diff,
ret = true, msg_type, num_colours, msg; ret = true, msg_type, num_colours, msg;
if (FBU.rects > 0) { if (FBU.rects > 0) {
...@@ -376,8 +381,8 @@ normal_msg: function () { ...@@ -376,8 +381,8 @@ normal_msg: function () {
case 2: ret = RFB.display_rre(); break; // RRE case 2: ret = RFB.display_rre(); break; // RRE
case 5: ret = RFB.display_hextile(); break; // hextile case 5: ret = RFB.display_hextile(); break; // hextile
} }
RFB.timing.cur_fbu += ((new Date()).getTime() - now = (new Date()).getTime();
RFB.timing.last_fbu); RFB.timing.cur_fbu += (now - RFB.timing.last_fbu);
if (FBU.rects === 0) { if (FBU.rects === 0) {
if ((FBU.width === RFB.fb_width) && if ((FBU.width === RFB.fb_width) &&
(FBU.height === RFB.fb_height)) { (FBU.height === RFB.fb_height)) {
...@@ -389,6 +394,18 @@ normal_msg: function () { ...@@ -389,6 +394,18 @@ normal_msg: function () {
RFB.timing.full_fbu_cnt + ", avg: " + RFB.timing.full_fbu_cnt + ", avg: " +
(RFB.timing.full_fbu_total / (RFB.timing.full_fbu_total /
RFB.timing.full_fbu_cnt)); RFB.timing.full_fbu_cnt));
if (RFB.timing.fbu_rt_start > 0) {
fbu_rt_diff = now - RFB.timing.fbu_rt_start;
RFB.timing.fbu_rt_total += fbu_rt_diff;
RFB.timing.fbu_rt_cnt += 1;
console.log("full FBU round-trip, cur: " +
fbu_rt_diff + ", total: " +
RFB.timing.fbu_rt_total + ", cnt: " +
RFB.timing.fbu_rt_cnt + ", avg: " +
(RFB.timing.fbu_rt_total /
RFB.timing.fbu_rt_cnt));
RFB.timing.fbu_rt_start = 0;
}
} }
} }
if (RFB.state !== "normal") { return true; } if (RFB.state !== "normal") { return true; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment