feat: hrp boom support set run time

This commit is contained in:
machongwei
2022-08-10 21:39:15 +08:00
parent 88c25d26c4
commit 61c34bfd16
4 changed files with 53 additions and 0 deletions
+2
View File
@@ -66,6 +66,7 @@ func (b *HRPBoomer) InitBoomer() {
}
b.SetSpawnCount(b.GetProfile().SpawnCount)
b.SetSpawnRate(b.GetProfile().SpawnRate)
b.SetRunTime(b.GetProfile().RunTime)
if b.GetProfile().LoopCount > 0 {
b.SetLoopCount(b.GetProfile().LoopCount)
}
@@ -232,6 +233,7 @@ func (b *HRPBoomer) rebalanceBoomer(profile *boomer.Profile) {
b.SetProfile(profile)
b.SetSpawnCount(b.GetProfile().SpawnCount)
b.SetSpawnRate(b.GetProfile().SpawnRate)
b.SetRunTime(b.GetProfile().RunTime)
b.GetRebalanceChan() <- true
log.Info().Interface("profile", profile).Msg("rebalance tasks successful")
}