Merge pull request #347 from pgreyson/master
Fixed iperf latency bug
diff --git a/web/ons-demo/RELEASE_NOTES.txt b/web/ons-demo/RELEASE_NOTES.txt
index 08e6ba0..c0e729f 100644
--- a/web/ons-demo/RELEASE_NOTES.txt
+++ b/web/ons-demo/RELEASE_NOTES.txt
@@ -1,3 +1,7 @@
+** April 8, 2013 **
+- merge from master
+- fix gradually increasing latency of iperf data display
+
** April 4, 2013 **
- denser iperf display
- don't pop alert on command error response. just log it
diff --git a/web/ons-demo/js/app.js b/web/ons-demo/js/app.js
index ea0ac83..6fa1bd3 100644
--- a/web/ons-demo/js/app.js
+++ b/web/ons-demo/js/app.js
@@ -308,8 +308,16 @@
}
var iperfData = JSON.parse(data);
+
+// console.log(iperfData.timestamp);
+
// if the data is fresh
if (flow.iperfData.timestamp && iperfData.timestamp != flow.iperfData.timestamp) {
+
+ while (flow.iperfData.samples.length > pointsToDisplay + iperfData.samples.length) {
+ flow.iperfData.samples.shift();
+ }
+
iperfData.samples.forEach(function (s) {
flow.iperfData.samples.push(s);
});