From f3990f950277c2f61e0e1811b4b8a81fc0219da4 Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Wed, 13 Dec 2023 19:56:03 -0500 Subject: [Feature] Support for testing upload/download in parallel Use the `--rpm.parallel` to test in parallel mode. The default testing mode is serial. Signed-off-by: Will Hawkins --- rpm/parameters.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'rpm/parameters.go') diff --git a/rpm/parameters.go b/rpm/parameters.go index 1d7e065..cc9fe7f 100644 --- a/rpm/parameters.go +++ b/rpm/parameters.go @@ -18,6 +18,7 @@ import ( "fmt" "time" + "github.com/network-quality/goresponsiveness/executor" "github.com/network-quality/goresponsiveness/utilities" ) @@ -31,9 +32,12 @@ type SpecParameters struct { ProbeInterval time.Duration ProbeCapacityPct float64 Percentile uint + ExecutionPolicy executor.ExecutionMethod } -func SpecParametersFromArguments(timeout int, mad int, id int, tmp uint, sdt float64, mnp int, mps int, ptc float64, p int) (*SpecParameters, error) { +func SpecParametersFromArguments(timeout int, mad int, id int, tmp uint, sdt float64, mnp int, + mps int, ptc float64, p int, executionPolicy executor.ExecutionMethod, +) (*SpecParameters, error) { if timeout <= 0 { return nil, fmt.Errorf("cannot specify a 0 or negative timeout for the test") } @@ -68,7 +72,8 @@ func SpecParametersFromArguments(timeout int, mad int, id int, tmp uint, sdt flo params := SpecParameters{ TestTimeout: testTimeout, MovingAvgDist: mad, EvalInterval: evalInterval, TrimmedMeanPct: tmp, StdDevTolerance: sdt, - MaxParallelConns: mnp, ProbeInterval: probeInterval, ProbeCapacityPct: ptc, Percentile: uint(p), + MaxParallelConns: mnp, ProbeInterval: probeInterval, ProbeCapacityPct: ptc, + Percentile: uint(p), ExecutionPolicy: executionPolicy, } return ¶ms, nil } @@ -82,8 +87,10 @@ Trimmed-Mean Percentage: %v, Standard-Deviation Tolerance: %v, Maximum number of parallel connections: %v, Probe Interval: %v (derived from given maximum-probes-per-second parameter), -Maximum Percentage Of Throughput For Probes: %v`, +Maximum Percentage Of Throughput For Probes: %v +Execution Policy: %v`, parameters.TestTimeout, parameters.MovingAvgDist, parameters.EvalInterval, parameters.TrimmedMeanPct, - parameters.StdDevTolerance, parameters.MaxParallelConns, parameters.ProbeInterval, parameters.ProbeCapacityPct, + parameters.StdDevTolerance, parameters.MaxParallelConns, parameters.ProbeInterval, + parameters.ProbeCapacityPct, parameters.ExecutionPolicy.ToString(), ) } -- cgit v1.2.3