diff options
| author | Will Hawkins <[email protected]> | 2024-01-29 09:49:51 -0500 | 
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2024-01-29 09:50:19 -0500 | 
| commit | 60b273e673b7af9b30bf439bb1a177ee339883ba (patch) | |
| tree | 0fef10b9f5a40c4c57af34417a4eb57fbc28619f | |
| parent | 59b565b068c007e0e99bfc382f32fda3bc0cfe6f (diff) | |
[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 <[email protected]>
| -rw-r--r-- | networkQuality.go | 21 | 
1 files 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)  | 
