delay after starting iperf before sampling data. otherwise can get data from the previous session and then the timestamp jumps
diff --git a/web/ons-demo/js/iperf.js b/web/ons-demo/js/iperf.js
index 8b1db26..b74175c 100644
--- a/web/ons-demo/js/iperf.js
+++ b/web/ons-demo/js/iperf.js
@@ -77,6 +77,7 @@
if (flow.flowId) {
iperfLog('starting iperf', flow);
startIPerf(flow, duration, updateRate/interval);
+
flow.iperfDisplayInterval = setInterval(function () {
if (flow.iperfData) {
var iperfPath = d3.select(document.getElementById(makeSelectedFlowKey(flow))).select('path');
@@ -182,7 +183,8 @@
// iperfLog(data, flow);
});
}
- fetchData();
+ // wait a buffer to make sure the old iperf session gets cleared out
+ setTimeout(fetchData, updateRate);
}
}
\ No newline at end of file