vortex-5 / ddwrt-bwmon

An Individual Bandwidth Monitor For DD-WRT
171 stars 37 forks source link

Accuracy on high latency connections could be improved. #11

Closed vortex-5 closed 8 years ago

vortex-5 commented 9 years ago

It has come to my attention that when processing the bandwidth readout on high latency connections I.E. slower wifi with many delays. The readouts can be inaccurate.

An simple way to deal with this is to update the service so it gives the current timestamp (in milliseconds) along with the actual bandwidth snapshot and then use that instead of our current method of taking a time stamp via the script.

vortex-5 commented 8 years ago

Done a simple averaging script that should make accuracy acceptable now.

We can't do time stamping since the version of DDWRT by default doesn't have nano second it only has second which isn't precise enough. It does't even have millisecond.

So the best we can do is take a sample of the request as it's made then another sample of the request as it's returned take the average and assume the actual bandwidth calculation is taken in between that time.

In practice this seems to work pretty accurately so I'll close this issue for now.