summaryrefslogtreecommitdiff
path: root/networkQuality.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2022-05-11 16:49:09 -0400
committerWill Hawkins <[email protected]>2022-05-11 16:49:09 -0400
commitfdfe96b53ef8f4532e5b6f65f86ba39fe242cc5b (patch)
tree22186a27e1a4dae9e338a683a3c1f08197bffca0 /networkQuality.go
parent49301ae7f6ef1c479fe3b23cba29d74a815d15ee (diff)
[Refactor/Bugfix] Refactor RPM calculation and fix calculation algorithm
As it turns out, I was misreading the algorithm for calculating the RPM based upon the measurements taken during execution. This patch fixes that mistake and also (starts) renames "RTT" as "measurement" (those are technically a better nomenclature according to the spec.)
Diffstat (limited to 'networkQuality.go')
-rw-r--r--networkQuality.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/networkQuality.go b/networkQuality.go
index 6b80a7e..2aba054 100644
--- a/networkQuality.go
+++ b/networkQuality.go
@@ -64,6 +64,11 @@ var (
constants.DefaultDebug,
"Enable debugging.",
)
+ strictFlag = flag.Bool(
+ "strict",
+ constants.DefaultStrict,
+ "Whether to run the test in strict mode (measure HTTP get time on load-generating connection)",
+ )
timeout = flag.Int(
"timeout",
constants.DefaultTestTime,
@@ -680,7 +685,7 @@ func main() {
{
rttTimeout = true
}
- case sequentialRTTimes := <-rpm.CalculateSequentialRTTsTime(operatingCtx, saturatedRTTProbe, newRTTProbe, config.Urls.SmallUrl, debugLevel):
+ case sequentialRTTimes := <-rpm.CalculateProbeMeasurements(operatingCtx, *strictFlag, saturatedRTTProbe, newRTTProbe, config.Urls.SmallUrl, debugLevel):
{
if sequentialRTTimes.Err != nil {
fmt.Printf(
@@ -694,7 +699,7 @@ func main() {
fmt.Printf("rttProbe: %v\n", newRTTProbe)
}
// We know that we have a good Sequential RTT.
- totalRTsCount += uint64(sequentialRTTimes.RoundTripCount)
+ totalRTsCount += uint64(sequentialRTTimes.MeasurementCount)
totalRTTimes += sequentialRTTimes.Delay.Seconds()
if debug.IsDebug(debugLevel) {
fmt.Printf(