Skip to content

Commit

Permalink
Merge #3722
Browse files Browse the repository at this point in the history
3722: [Benchmark] Non-blocking SetTPS r=SaveTheRbtz a=SaveTheRbtz

Currently, `SetTPS` is a blocking call.  Since it only blocks in cases where we decrease TPS (waiting for current transaction to finish) -- it causes tests to be biassed towards lower numbers.

Co-authored-by: Alexey Ivanov <rbtz@dapperlabs.com>
  • Loading branch information
bors[bot] and SaveTheRbtz authored Dec 16, 2022
2 parents ed9778f + 6b9e711 commit 5b2986f
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions integration/benchmark/contLoadGenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,21 +284,16 @@ func (lg *ContLoadGenerator) stopWorkers(num int) error {
return fmt.Errorf("can't stop %d workers, only %d available", num, len(lg.workers))
}

wg := sync.WaitGroup{}
wg.Add(num)

idx := len(lg.workers) - num
toRemove := lg.workers[idx:]
lg.workers = lg.workers[:idx]

for _, w := range toRemove {
go func(w *Worker) {
defer wg.Done()
lg.log.Debug().Int("workerID", w.workerID).Msg("stopping worker")
w.Stop()
}(w)
}
wg.Wait()
lg.workerStatsTracker.AddWorkers(-num)

return nil
Expand Down

0 comments on commit 5b2986f

Please sign in to comment.