mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-31 21:39:41 +08:00
change: report event for initializing plugin
This commit is contained in:
21
runner.go
21
runner.go
@@ -506,6 +506,27 @@ func (r *caseRunner) parseConfig(config IConfig) error {
|
||||
|
||||
// init plugin
|
||||
var err error
|
||||
defer func() {
|
||||
if r.parser.plugin == nil {
|
||||
return
|
||||
}
|
||||
var pluginType string
|
||||
if _, ok := r.parser.plugin.(*common.GoPlugin); ok {
|
||||
pluginType = "go"
|
||||
} else {
|
||||
pluginType = "hashicorp"
|
||||
}
|
||||
|
||||
// report event for initializing plugin
|
||||
event := ga.EventTracking{
|
||||
Category: "InitPlugin",
|
||||
Action: fmt.Sprintf("Init %s plugin", pluginType),
|
||||
}
|
||||
if err != nil {
|
||||
event.Value = 1 // failed
|
||||
}
|
||||
go ga.SendEvent(event)
|
||||
}()
|
||||
r.parser.plugin, err = common.Init(cfg.Path)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user