mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
feat: spawn workers with rate limit
This commit is contained in:
+2
-1
@@ -3,7 +3,8 @@
|
|||||||
## v0.3.0 (2021-12-22)
|
## v0.3.0 (2021-12-22)
|
||||||
|
|
||||||
- feat: implement `transaction` mechanism for load test
|
- feat: implement `transaction` mechanism for load test
|
||||||
- feat: support `--continue-on-failure` flag to continue running next step when failure occurs, default to failfast
|
- feat: continue running next step when failure occurs with `--continue-on-failure` flag, default to failfast
|
||||||
|
- feat: spawn workers with `--spawn-rate` flag
|
||||||
- refactor: fork [boomer] as sub module
|
- refactor: fork [boomer] as sub module
|
||||||
- feat: report GA events with version
|
- feat: report GA events with version
|
||||||
- feat: run load test with the given limit and burst as rate limiter
|
- feat: run load test with the given limit and burst as rate limiter
|
||||||
|
|||||||
@@ -117,8 +117,11 @@ func (r *runner) spawnWorkers(spawnCount int, spawnRate float64, quit chan bool,
|
|||||||
Msg("Spawning workers")
|
Msg("Spawning workers")
|
||||||
|
|
||||||
atomic.StoreInt32(&r.state, stateSpawning)
|
atomic.StoreInt32(&r.state, stateSpawning)
|
||||||
// TODO: spawn workers with spawnRate
|
|
||||||
for i := 1; i <= spawnCount; i++ {
|
for i := 1; i <= spawnCount; i++ {
|
||||||
|
// spawn workers with rate limit
|
||||||
|
sleepTime := time.Duration(1000000/r.spawnRate) * time.Microsecond
|
||||||
|
time.Sleep(sleepTime)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-quit:
|
case <-quit:
|
||||||
// quit spawning goroutine
|
// quit spawning goroutine
|
||||||
|
|||||||
Reference in New Issue
Block a user