fix: typo

change: do not add console output by default

feat: add GA for docs

refactor: move builtin to internal

refactor: relocate sentry sdk

feat: report events with ga

change: use http client session

fix: report GA events

change: sentry
This commit is contained in:
debugtalk
2021-11-22 16:23:47 +08:00
parent ae7710e9d0
commit 7fd26395ed
30 changed files with 286 additions and 42 deletions

View File

@@ -4,6 +4,8 @@ import (
"time"
"github.com/myzhan/boomer"
"github.com/httprunner/hrp/internal/ga"
)
func NewStandaloneBoomer(spawnCount int, spawnRate float64) *Boomer {
@@ -11,7 +13,6 @@ func NewStandaloneBoomer(spawnCount int, spawnRate float64) *Boomer {
Boomer: boomer.NewStandaloneBoomer(spawnCount, spawnRate),
debug: false,
}
b.AddOutput(boomer.NewConsoleOutput())
return b
}
@@ -26,6 +27,15 @@ func (b *Boomer) SetDebug(debug bool) *Boomer {
}
func (b *Boomer) Run(testcases ...ITestCase) {
event := ga.EventTracking{
Category: "RunLoadTests",
Action: "hrp boom",
}
// report start event
go ga.SendEvent(event)
// report execution timing event
defer ga.SendEvent(event.StartTiming("execution"))
var taskSlice []*boomer.Task
for _, iTestCase := range testcases {
testcase, err := iTestCase.ToTestCase()