[Freeswitch-dev] HTML5 Verto speed test computation question

Philippe Sultan philippe.sultan at gmail.com
Thu Sep 7 22:09:35 UTC 2017


Hi,

The bandwidth computation in the HTML5 JavaScript client in file
html5/verto/js/src/jquery.jsonrpcclient.js, is :

var up_kps = (((this.speedBytes * 8) / (this.up_dur / 1000)) /
1024).toFixed(0);
var down_kps = (((this.speedBytes * 8) / (this.down_dur / 1000)) /
1024).toFixed(0);

this.speedBytes being the total number of transferred bytes, converted to
bits after *8, I was wondering if the total shouldn't be divided by 1000
rather than 1024 in order to get a a result in kbits/s, that is :

var up_kps = (((this.speedBytes * 8) / (this.up_dur / 1000)) /
1000).toFixed(0);
var down_kps = (((this.speedBytes * 8) / (this.down_dur / 1000)) /
1000).toFixed(0);

Am I missing something here ? Thanks !
Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20170908/285685e6/attachment.html>


More information about the FreeSWITCH-dev mailing list