change: report event for initializing plugin

This commit is contained in:
debugtalk
2022-01-17 17:20:47 +08:00
parent acf5b34adb
commit b2e0c0ba11
2 changed files with 35 additions and 27 deletions

View File

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