Improved auto test duration formula

This commit is contained in:
dosse91 2020-09-27 20:18:01 +02:00
parent 5cef820749
commit e36de9a6ce

View file

@ -403,8 +403,8 @@ function dlTest(done) {
var speed = totLoaded / (t / 1000.0);
if (settings.time_auto) {
//decide how much to shorten the test. Every 200ms, the test is shortened by the bonusT calculated here
var bonus = (6.4 * speed) / 100000;
bonusT += bonus > 800 ? 800 : bonus;
var bonus = (5.0 * speed) / 100000;
bonusT += bonus > 400 ? 400 : bonus;
}
//update status
dlStatus = ((speed * 8 * settings.overheadCompensationFactor) / (settings.useMebibits ? 1048576 : 1000000)).toFixed(2); // speed is multiplied by 8 to go from bytes to bits, overhead compensation is applied, then everything is divided by 1048576 or 1000000 to go to megabits/mebibits
@ -551,8 +551,8 @@ function ulTest(done) {
var speed = totLoaded / (t / 1000.0);
if (settings.time_auto) {
//decide how much to shorten the test. Every 200ms, the test is shortened by the bonusT calculated here
var bonus = (6.4 * speed) / 100000;
bonusT += bonus > 800 ? 800 : bonus;
var bonus = (5.0 * speed) / 100000;
bonusT += bonus > 400 ? 400 : bonus;
}
//update status
ulStatus = ((speed * 8 * settings.overheadCompensationFactor) / (settings.useMebibits ? 1048576 : 1000000)).toFixed(2); // speed is multiplied by 8 to go from bytes to bits, overhead compensation is applied, then everything is divided by 1048576 or 1000000 to go to megabits/mebibits