Merge pull request #71 from bbx-winner/main

feat: implement `rendezvous` mechanism for load test
This commit is contained in:
debugtalk
2022-01-25 20:25:40 +08:00
committed by GitHub
9 changed files with 468 additions and 11 deletions

View File

@@ -127,3 +127,11 @@ func (b *Boomer) RecordFailure(requestType, name string, responseTime int64, exc
func (b *Boomer) Quit() {
b.localRunner.stop()
}
func (b *Boomer) IsSpawnDone() bool {
return b.localRunner.isSpawnDone
}
func (b *Boomer) GetSpawnCount() int {
return b.localRunner.spawnCount
}

View File

@@ -63,6 +63,7 @@ type runner struct {
spawnCount int // target clients to spawn
spawnRate float64
loop *Loop // specify running cycles
isSpawnDone bool
outputs []Output
}
@@ -193,6 +194,7 @@ func (r *localRunner) spawnWorkers(spawnCount int, spawnRate float64, quit chan
}
}
r.isSpawnDone = true
if spawnCompleteFunc != nil {
spawnCompleteFunc()
}