mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-07 16:59:34 +08:00
feat: report GA4 events for hrp cmd
This commit is contained in:
@@ -54,8 +54,15 @@ func CopyFile(templateFile, targetFile string) error {
|
||||
}
|
||||
|
||||
func CreateScaffold(projectName string, pluginType PluginType, venv string, force bool) error {
|
||||
// report event
|
||||
sdk.SendGA4Event("hrp_startproject", nil)
|
||||
// report GA event
|
||||
startTime := time.Now()
|
||||
defer func() {
|
||||
sdk.SendGA4Event("hrp_startproject", map[string]interface{}{
|
||||
"pluginType": string(pluginType),
|
||||
"force": force,
|
||||
"engagement_time_msec": time.Since(startTime).Milliseconds(),
|
||||
})
|
||||
}()
|
||||
|
||||
log.Info().
|
||||
Str("projectName", projectName).
|
||||
|
||||
Reference in New Issue
Block a user