mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-07 15:31:23 +08:00
fix: print boomer console output
This commit is contained in:
@@ -7,10 +7,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewStandaloneBoomer(spawnCount int, spawnRate float64) *Boomer {
|
func NewStandaloneBoomer(spawnCount int, spawnRate float64) *Boomer {
|
||||||
return &Boomer{
|
b := &Boomer{
|
||||||
Boomer: boomer.NewStandaloneBoomer(spawnCount, spawnRate),
|
Boomer: boomer.NewStandaloneBoomer(spawnCount, spawnRate),
|
||||||
debug: false,
|
debug: false,
|
||||||
}
|
}
|
||||||
|
b.AddOutput(boomer.NewConsoleOutput())
|
||||||
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
type Boomer struct {
|
type Boomer struct {
|
||||||
@@ -53,9 +55,9 @@ func (b *Boomer) convertBoomerTask(testcase *TestCase) *boomer.Task {
|
|||||||
stepData, err := runner.runStep(step, config)
|
stepData, err := runner.runStep(step, config)
|
||||||
elapsed := time.Since(start).Nanoseconds() / int64(time.Millisecond)
|
elapsed := time.Since(start).Nanoseconds() / int64(time.Millisecond)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
boomer.RecordSuccess(step.Type(), step.Name(), elapsed, stepData.ResponseLength)
|
b.RecordSuccess(step.Type(), step.Name(), elapsed, stepData.ResponseLength)
|
||||||
} else {
|
} else {
|
||||||
boomer.RecordFailure(step.Type(), step.Name(), elapsed, err.Error())
|
b.RecordFailure(step.Type(), step.Name(), elapsed, err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user