mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-26 10:50:12 +08:00
change: update models
This commit is contained in:
12
boomer.go
12
boomer.go
@@ -9,27 +9,27 @@ import (
|
||||
"github.com/httprunner/hrp/internal/ga"
|
||||
)
|
||||
|
||||
func NewBoomer(spawnCount int, spawnRate float64) *hrpBoomer {
|
||||
b := &hrpBoomer{
|
||||
func NewBoomer(spawnCount int, spawnRate float64) *HRPBoomer {
|
||||
b := &HRPBoomer{
|
||||
Boomer: boomer.NewStandaloneBoomer(spawnCount, spawnRate),
|
||||
debug: false,
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
type hrpBoomer struct {
|
||||
type HRPBoomer struct {
|
||||
*boomer.Boomer
|
||||
debug bool
|
||||
}
|
||||
|
||||
// SetDebug configures whether to log HTTP request and response content.
|
||||
func (b *hrpBoomer) SetDebug(debug bool) *hrpBoomer {
|
||||
func (b *HRPBoomer) SetDebug(debug bool) *HRPBoomer {
|
||||
b.debug = debug
|
||||
return b
|
||||
}
|
||||
|
||||
// Run starts to run load test for one or multiple testcases.
|
||||
func (b *hrpBoomer) Run(testcases ...ITestCase) {
|
||||
func (b *HRPBoomer) Run(testcases ...ITestCase) {
|
||||
event := ga.EventTracking{
|
||||
Category: "RunLoadTests",
|
||||
Action: "hrp boom",
|
||||
@@ -51,7 +51,7 @@ func (b *hrpBoomer) Run(testcases ...ITestCase) {
|
||||
b.Boomer.Run(taskSlice...)
|
||||
}
|
||||
|
||||
func (b *hrpBoomer) convertBoomerTask(testcase *TestCase) *boomer.Task {
|
||||
func (b *HRPBoomer) convertBoomerTask(testcase *TestCase) *boomer.Task {
|
||||
hrpRunner := NewRunner(nil).SetDebug(b.debug)
|
||||
config := testcase.Config.ToStruct()
|
||||
return &boomer.Task{
|
||||
|
||||
Reference in New Issue
Block a user