mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-20 07:40:32 +08:00
fix: broadcast to all rendezvous at once when spawn done
Change-Id: Ic04bc2f56aa40c2af42a1fdb3c261a10e8346033
This commit is contained in:
@@ -128,8 +128,8 @@ func (b *Boomer) Quit() {
|
||||
b.localRunner.stop()
|
||||
}
|
||||
|
||||
func (b *Boomer) IsSpawnDone() bool {
|
||||
return b.localRunner.isSpawnDone
|
||||
func (b *Boomer) GetSpawnDoneChan() chan struct{} {
|
||||
return b.localRunner.spawnDone
|
||||
}
|
||||
|
||||
func (b *Boomer) GetSpawnCount() int {
|
||||
|
||||
@@ -63,7 +63,7 @@ type runner struct {
|
||||
spawnCount int // target clients to spawn
|
||||
spawnRate float64
|
||||
loop *Loop // specify running cycles
|
||||
isSpawnDone bool
|
||||
spawnDone chan struct{}
|
||||
|
||||
outputs []Output
|
||||
}
|
||||
@@ -194,7 +194,7 @@ func (r *localRunner) spawnWorkers(spawnCount int, spawnRate float64, quit chan
|
||||
}
|
||||
}
|
||||
|
||||
r.isSpawnDone = true
|
||||
close(r.spawnDone)
|
||||
if spawnCompleteFunc != nil {
|
||||
spawnCompleteFunc()
|
||||
}
|
||||
@@ -256,6 +256,7 @@ func newLocalRunner(spawnCount int, spawnRate float64) *localRunner {
|
||||
spawnCount: spawnCount,
|
||||
stats: newRequestStats(),
|
||||
outputs: make([]Output, 0),
|
||||
spawnDone: make(chan struct{}),
|
||||
},
|
||||
stopChan: make(chan bool),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user