From 59b565b068c007e0e99bfc382f32fda3bc0cfe6f Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Sat, 27 Jan 2024 22:04:12 -0500 Subject: [Bugfix] Do not advance the interval when stable By advancing the stability algorithm's interval when the measurement is complete, we incorrectly expelled one of those intervals from the RPM calculation. As a result, the final RPM calculation did not include all the probe measurements that factored into stability calculation. Signed-off-by: Will Hawkins --- networkQuality.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/networkQuality.go b/networkQuality.go index e88a000..5a6d4ab 100644 --- a/networkQuality.go +++ b/networkQuality.go @@ -636,7 +636,11 @@ func main() { utilities.Conditional(baselineStableResponsiveness, "stable", "unstable")) } - baselineResponsivenessStabilizer.Interval() + // Do not tick an interval if we are stable. Doing so would expel one of the + // intervals that we need for our RPM calculations! + if !baselineStableResponsiveness { + baselineResponsivenessStabilizer.Interval() + } } } } @@ -951,7 +955,11 @@ func main() { utilities.Conditional(direction.StableResponsiveness, "stable", "unstable")) } - responsivenessStabilizer.Interval() + // Do not tick an interval if we are stable. Doing so would expel one of the + // intervals that we need for our RPM calculations! + if !direction.StableResponsiveness { + responsivenessStabilizer.Interval() + } } } } -- cgit v1.2.3