From 60b273e673b7af9b30bf439bb1a177ee339883ba Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Mon, 29 Jan 2024 09:49:51 -0500 Subject: [Feature] Special RPM calculation semantics when test does not stabilize When the test does not stabilize (responsiveness), using only the most recent MAD probes to calculate the provisional final RPM could leave us with a very small number of samples. So, instead, use all the probe measurements to do the calculation. Signed-off-by: Will Hawkins --- networkQuality.go | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/networkQuality.go b/networkQuality.go index 5a6d4ab..e1badd9 100644 --- a/networkQuality.go +++ b/networkQuality.go @@ -1231,10 +1231,23 @@ func main() { boundedAllSelfRtts := series.NewWindowSeries[float64, uint64](series.Forever, 0) boundedAllForeignRtts := series.NewWindowSeries[float64, uint64](series.Forever, 0) - boundedAllSelfRtts.BoundedAppend(&downloadDirection.SelfRtts) - boundedAllSelfRtts.BoundedAppend(&uploadDirection.SelfRtts) - boundedAllForeignRtts.BoundedAppend(&downloadDirection.ForeignRtts) - boundedAllForeignRtts.BoundedAppend(&uploadDirection.ForeignRtts) + // Now, if the test had a stable responsiveness measurement, then only consider the + // probe measurements that are in the MAD intervals. On the other hand, if the test + // did not stabilize, use all measurements to calculate the RPM. + if downloadDirection.StableResponsiveness { + boundedAllSelfRtts.BoundedAppend(&downloadDirection.SelfRtts) + boundedAllForeignRtts.BoundedAppend(&downloadDirection.ForeignRtts) + } else { + boundedAllSelfRtts.Append(&downloadDirection.SelfRtts) + boundedAllForeignRtts.Append(&downloadDirection.ForeignRtts) + } + if uploadDirection.StableResponsiveness { + boundedAllSelfRtts.BoundedAppend(&uploadDirection.SelfRtts) + boundedAllForeignRtts.BoundedAppend(&uploadDirection.ForeignRtts) + } else { + boundedAllSelfRtts.Append(&uploadDirection.SelfRtts) + boundedAllForeignRtts.Append(&uploadDirection.ForeignRtts) + } result := rpm.CalculateRpm(boundedAllSelfRtts, boundedAllForeignRtts, specParameters.TrimmedMeanPct, specParameters.Percentile) -- cgit v1.2.3