Merge branch 'master' into docker

This commit is contained in:
adolfintel 2018-09-20 15:43:29 +02:00
commit d79d0d3c99
2 changed files with 4 additions and 2 deletions

View file

@ -443,7 +443,9 @@ function pingTest (done) {
var instjitter = Math.abs(instspd - prevInstspd)
if (i === 1) ping = instspd; /* first ping, can't tell jitter yet*/ else {
ping = instspd < ping ? instspd : ping * 0.8 + instspd * 0.2 // update ping, weighted average. if the instant ping is lower than the current average, it is set to that value instead of averaging
jitter = instjitter > jitter ? (jitter * 0.3 + instjitter * 0.7) : (jitter * 0.8 + instjitter * 0.2) // update jitter, weighted average. spikes in ping values are given more weight.
if(i === 2) jitter=instjitter //discard the first jitter measurement because it might be much higher than it should be
else
jitter = instjitter > jitter ? (jitter * 0.3 + instjitter * 0.7) : (jitter * 0.8 + instjitter * 0.2) // update jitter, weighted average. spikes in ping values are given more weight.
}
prevInstspd = instspd
}

File diff suppressed because one or more lines are too long