summaryrefslogtreecommitdiff
path: root/networkQuality.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2023-07-14 10:55:02 -0400
committerWill Hawkins <[email protected]>2023-07-14 10:58:51 -0400
commitdf37c3e0d572ff3b4b4de3e9919402e8e0ccf971 (patch)
tree62e35137fa3d233f5506804775b6c71e728e71c3 /networkQuality.go
parent399eda676f7889accf72231c6696b89de7ea3fae (diff)
Parameterize Percentile in RPM Calculations
Make the percentile used by RPM calculations user-controlled. Note: A percentile-based calculation is not part of the spec. This is an optional feature. Signed-off-by: Will Hawkins <[email protected]>
Diffstat (limited to 'networkQuality.go')
-rw-r--r--networkQuality.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/networkQuality.go b/networkQuality.go
index 9671eb3..3bd6767 100644
--- a/networkQuality.go
+++ b/networkQuality.go
@@ -109,6 +109,11 @@ var (
constants.SpecParameterCliOptionsDefaults.Ptc,
"Percentage of the (discovered) total network capacity that probes are allowed to consume.",
)
+ rpmp = flag.Int(
+ "rpm.p",
+ constants.SpecParameterCliOptionsDefaults.P,
+ "Percentile of results to consider when calculating responsiveness.",
+ )
sslKeyFileName = flag.String(
"ssl-key-file",
@@ -172,7 +177,7 @@ func main() {
}
specParameters, err := rpm.SpecParametersFromArguments(*rpmtimeout, *rpmmad, *rpmid,
- *rpmtmp, *rpmsdt, *rpmmnp, *rpmmps, *rpmptc)
+ *rpmtmp, *rpmsdt, *rpmmnp, *rpmmps, *rpmptc, *rpmp)
if err != nil {
fmt.Fprintf(
os.Stderr,
@@ -846,7 +851,8 @@ func main() {
if *calculateExtendedStats {
fmt.Println(extendedStats.Repr())
}
- directionResult := rpm.CalculateRpm(perDirectionSelfRtts, perDirectionForeignRtts, specParameters.TrimmedMeanPct, 90)
+ directionResult := rpm.CalculateRpm(perDirectionSelfRtts, perDirectionForeignRtts,
+ specParameters.TrimmedMeanPct, specParameters.Percentile)
if *debugCliFlag {
fmt.Printf("(%s RPM Calculation stats): %v\n", direction.DirectionLabel, directionResult.ToString())
}