change: update models

This commit is contained in:
debugtalk
2021-12-30 18:02:15 +08:00
parent e98b1c848a
commit 46f2eeed79
3 changed files with 16 additions and 16 deletions

View File

@@ -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{