summaryrefslogtreecommitdiff
path: root/rpm/calculations.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2023-07-14 14:08:57 -0400
committerWill Hawkins <[email protected]>2023-07-14 15:26:30 -0400
commitcca033fe0d7389bfa647afa47a47de2a3f6af47d (patch)
treea114899b9b78cf775b920a303dfd98da76151c92 /rpm/calculations.go
parent123e75ac641721de9c19a652c9b1450b60bc7ef9 (diff)
[Feature] Relative RPM
With this feature, the user can use `--relative-rpm` to gather additional data: a relative RPM. The relative RPM score 1. Calculates an RPM before working conditions are achieved. 2. Achieves working conditions (upload and download) 3. Calculates an RPM under working conditions (upload and download) 4. Calculates the percent difference between the RPM calculated in (1) and the RPMs calculated in (3). Signed-off-by: Will Hawkins <[email protected]>
Diffstat (limited to 'rpm/calculations.go')
-rw-r--r--rpm/calculations.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpm/calculations.go b/rpm/calculations.go
index 8b3cf92..f3619dc 100644
--- a/rpm/calculations.go
+++ b/rpm/calculations.go
@@ -37,7 +37,7 @@ type Rpm[Data utilities.Number] struct {
func CalculateRpm[Data utilities.Number, Bucket constraints.Ordered](
selfRtts series.WindowSeries[Data, Bucket], aggregatedForeignRtts series.WindowSeries[Data, Bucket], trimming uint, percentile uint,
-) Rpm[Data] {
+) *Rpm[Data] {
// There may be more than one round trip accumulated together. If that is the case,
// we will blow them apart in to three separate measurements and each one will just
// be 1 / 3.
@@ -82,7 +82,7 @@ func CalculateRpm[Data utilities.Number, Bucket constraints.Ordered](
pnRpm := 60.0 / (float64(selfProbeRoundTripTimePN+foreignProbeRoundTripTimePN) / 2.0)
meanRpm := 60.0 / (float64(selfProbeRoundTripTimeMean+foreignProbeRoundTripTimeMean) / 2.0)
- return Rpm[Data]{
+ return &Rpm[Data]{
SelfRttsTotal: selfRttsTotalCount, ForeignRttsTotal: foreignRttsTotalCount,
SelfRttsTrimmed: selfRttsTrimmedCount, ForeignRttsTrimmed: foreignRttsTrimmedCount,
SelfProbeRttPN: selfProbeRoundTripTimePN, ForeignProbeRttPN: foreignProbeRoundTripTimePN,