Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions apps/loadgen/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,14 @@ func runScheduler(parent context.Context, cfg startConfig) error {

var wg sync.WaitGroup
runWorkload := func(label, matrixPath string, txCount int) {
defer wg.Done()
log.Printf("==> %s workload starting (%d tx)", label, txCount)
if err := runner.ExecuteMatrixWithOverridesFromFile(ctx, matrixPath, api, txCount); err != nil {
log.Printf("%s workload error: %v", label, err)
}
}

// fire regular immediately
wg.Add(1)
go runWorkload("regular", cfg.regularMatrix, regularTxPerRun)
wg.Go(func() { runWorkload("regular", cfg.regularMatrix, regularTxPerRun) })

ticker := time.NewTicker(cfg.interval)
defer ticker.Stop()
Expand All @@ -112,12 +110,10 @@ func runScheduler(parent context.Context, cfg startConfig) error {
return nil

case <-ticker.C:
wg.Add(1)
go runWorkload("regular", cfg.regularMatrix, regularTxPerRun)
wg.Go(func() { runWorkload("regular", cfg.regularMatrix, regularTxPerRun) })

case <-burstTimer.C:
wg.Add(1)
go runWorkload("burst", cfg.burstMatrix, cfg.burstTxCount)
wg.Go(func() { runWorkload("burst", cfg.burstMatrix, cfg.burstTxCount) })
burstsRemaining--
burstTimer = nextBurstTimer(burstsRemaining, time.Until(nextReset))

Expand Down