summaryrefslogtreecommitdiff
path: root/rpm/rpm.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2024-01-19 19:37:11 -0500
committerWill Hawkins <[email protected]>2024-01-19 19:40:11 -0500
commit65b039e33717ee43620363704cb3daa304a5e724 (patch)
tree3cdb4c7f06147e20344a5f80bbdb0865ea0e2126 /rpm/rpm.go
parent00cd532f0c6860e11902240411204418db79e0d0 (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]>
Diffstat (limited to 'rpm/rpm.go')
-rw-r--r--rpm/rpm.go18
1 files changed, 3 insertions, 15 deletions
diff --git a/rpm/rpm.go b/rpm/rpm.go
index 905e578..e555912 100644
--- a/rpm/rpm.go
+++ b/rpm/rpm.go
@@ -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()