mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 18:11:21 +08:00
fix: disable keep alive
This commit is contained in:
@@ -19,9 +19,6 @@ func NewBoomer(spawnCount int, spawnRate float64) *HRPBoomer {
|
||||
}
|
||||
|
||||
b.hrpRunner = NewRunner(nil)
|
||||
// set client transport for high concurrency load testing
|
||||
b.hrpRunner.SetClientTransport(b.GetSpawnCount(), b.GetDisableKeepAlive(), b.GetDisableCompression())
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -32,6 +29,11 @@ type HRPBoomer struct {
|
||||
pluginsMutex *sync.RWMutex // avoid data race
|
||||
}
|
||||
|
||||
func (b *HRPBoomer) SetClientTransport() {
|
||||
// set client transport for high concurrency load testing
|
||||
b.hrpRunner.SetClientTransport(b.GetSpawnCount(), b.GetDisableKeepAlive(), b.GetDisableCompression())
|
||||
}
|
||||
|
||||
// Run starts to run load test for one or multiple testcases.
|
||||
func (b *HRPBoomer) Run(testcases ...ITestCase) {
|
||||
event := sdk.EventTracking{
|
||||
|
||||
@@ -41,6 +41,7 @@ var boomCmd = &cobra.Command{
|
||||
}
|
||||
hrpBoomer.SetDisableKeepAlive(disableKeepalive)
|
||||
hrpBoomer.SetDisableCompression(disableCompression)
|
||||
hrpBoomer.SetClientTransport()
|
||||
hrpBoomer.EnableCPUProfile(cpuProfile, cpuProfileDuration)
|
||||
hrpBoomer.EnableMemoryProfile(memoryProfile, memoryProfileDuration)
|
||||
hrpBoomer.EnableGracefulQuit()
|
||||
|
||||
Reference in New Issue
Block a user