Skip to content

Commit

Permalink
change EWMA factor from 0.0625 (31 period) to 0.2222 (8 period)
Browse files Browse the repository at this point in the history
  • Loading branch information
SCG82 committed Feb 8, 2021
1 parent ff82974 commit 34c3991
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion speedtest_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ function pingTest(done) {
} else {
if (instspd < ping) ping = instspd; // update ping, if the instant ping is lower
if (i === 2) jitter = instjitter; // discard the first jitter measurement because it might be much higher than it should be
else jitter += (instjitter - jitter) / 16; // RFC 3550
else jitter += (instjitter - jitter) * 2 / 9;
// 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;
Expand Down

0 comments on commit 34c3991

Please sign in to comment.