1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-16 04:45:18 +03:00

load balancing on oter tabs

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-01-22 20:49:40 +01:00
parent 297ad70c5d
commit 35adb962fb
4 changed files with 20 additions and 13 deletions

View file

@ -11,8 +11,8 @@ helper.mspQueue = (function (serial, MSP) {
privateScope.balancerFrequency = 10;
privateScope.loadFilter = new classes.SimpleSmoothFilter(0.5, 0.995);
privateScope.roundtripFilter = new classes.SimpleSmoothFilter(20, 0.95);
privateScope.hardwareRoundtripFilter = new classes.SimpleSmoothFilter(5, 0.95);
privateScope.roundtripFilter = new classes.SimpleSmoothFilter(20, 0.97);
privateScope.hardwareRoundtripFilter = new classes.SimpleSmoothFilter(5, 0.97);
/**
* Target load for MSP queue. When load is above target, throttling might start to appear
@ -255,13 +255,13 @@ helper.mspQueue = (function (serial, MSP) {
* @returns {number}
*/
publicScope.getIntervalPrediction = function (requestedInterval, messagesInInterval) {
var openWindow = publicScope.getRoundtrip() * 1.25,
requestedWindow = requestedInterval / messagesInInterval;
var requestedRate = (1000 / requestedInterval) * messagesInInterval,
availableRate = (1000 / publicScope.getRoundtrip()) * 0.75;
if (requestedWindow < openWindow) {
return openWindow;
} else {
if (requestedRate < availableRate) {
return requestedInterval;
} else {
return (1000 / availableRate) * messagesInInterval;
}
};