diff options
| author | Will Hawkins <[email protected]> | 2024-01-19 19:37:11 -0500 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2024-01-19 19:40:11 -0500 |
| commit | 65b039e33717ee43620363704cb3daa304a5e724 (patch) | |
| tree | 3cdb4c7f06147e20344a5f80bbdb0865ea0e2126 | |
| parent | 00cd532f0c6860e11902240411204418db79e0d0 (diff) | |
[Bugfix] Continue Adding LGCs During Responsiveness Stabilization
The client was not continuing to add load-generating connections at each
stability-check interval (as called for by the spec).
Also, the client now properly obeys the `--rpm.id` option given on the
command line.
Signed-off-by: Will Hawkins <[email protected]>
| -rw-r--r-- | networkQuality.go | 8 | ||||
| -rw-r--r-- | rpm/rpm.go | 18 |
2 files changed, 4 insertions, 22 deletions
diff --git a/networkQuality.go b/networkQuality.go index 355e1b3..f22cc32 100644 --- a/networkQuality.go +++ b/networkQuality.go @@ -686,18 +686,15 @@ func main() { throughputCtx, throughputCtxCancel := context.WithCancel(operatingCtx) direction.ThroughputActivityCtx, direction.ThroughputActivityCtxCancel = &throughputCtx, &throughputCtxCancel - reachWorkingConditionsCtx, reachWorkingConditionsCtxCancel := - context.WithCancel(throughputOperatorCtx) - lgStabilizationCommunicationChannel := rpm.LoadGenerator( throughputOperatorCtx, *direction.ThroughputActivityCtx, - reachWorkingConditionsCtx, specParameters.EvalInterval, direction.CreateLgdc, &direction.Lgcc, &globalNumericBucketGenerator, specParameters.MaxParallelConns, + specParameters.EvalInterval, *calculateExtendedStats, direction.DirectionDebugging, ) @@ -812,9 +809,6 @@ func main() { ) } - // No matter what, we will stop adding additional load-generating connections! - reachWorkingConditionsCtxCancel() - direction.SelfRtts = series.NewWindowSeries[float64, uint64](series.Forever, 0) direction.ForeignRtts = series.NewWindowSeries[float64, uint64](series.Forever, 0) @@ -340,12 +340,12 @@ func ResponsivenessProber[BucketType utilities.Number]( func LoadGenerator[BucketType utilities.Number]( throughputCtx context.Context, // Stop our activity when we no longer need any throughput networkActivityCtx context.Context, // Create all network connections in this context. - generateLoadCtx context.Context, // Stop adding additional throughput when we are stable. rampupInterval time.Duration, lgcGenerator func() lgc.LoadGeneratingConnection, // Use this to generate a new load-generating connection. loadGeneratingConnectionsCollection *lgc.LoadGeneratingConnectionCollection, bucketGenerator *series.NumericBucketGenerator[BucketType], mnp int, + id time.Duration, // the interval to wait to test for stability (it doubles as the time between adding LGCs). captureExtendedStats bool, // do we want to attempt to gather TCP information on these connections? debugging *debug.DebugWithPrefix, // How can we forget debugging? ) (seriesCommunicationChannel chan series.SeriesMessage[ThroughputDataPoint, BucketType]) { // Send back all the instantaneous throughputs that we generate. @@ -383,9 +383,9 @@ func LoadGenerator[BucketType utilities.Number]( } time.Sleep(nextSampleStartTime.Sub(now)) } else { - fmt.Fprintf(os.Stderr, "Warning: Missed a one-second deadline.\n") + fmt.Fprintf(os.Stderr, "Warning: Missed a %v deadline.\n", id.Milliseconds()) } - nextSampleStartTime = time.Now().Add(time.Second) + nextSampleStartTime = time.Now().Add(id) // Waiting is the hardest part -- that was a long time asleep // and we may have been cancelled during that time! @@ -513,18 +513,6 @@ func LoadGenerator[BucketType utilities.Number]( Measure: utilities.Some[ThroughputDataPoint](throughputDataPoint), } - if generateLoadCtx.Err() != nil { - // No need to add additional data points because the controller told us - // that we were stable. But, we want to continue taking measurements! - if debug.IsDebug(debugging.Level) { - fmt.Printf( - "%v: Throughput is stable; not adding any additional load-generating connections.\n", - debugging, - ) - } - continue - } - loadGeneratingConnectionsCollection.Lock.Lock() currentParallelConnectionCount, err := loadGeneratingConnectionsCollection.Len() |
