Skip to content

Commit fc5746e

Browse files
committed
fix run telemetry [no test]
1 parent 287396a commit fc5746e

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

cmd/sling/sling.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,9 @@ func cliInit() int {
363363

364364
switch {
365365
case g.CliObj.Name == "conns" && g.In(g.CliObj.UsedSC(), "test", "discover"):
366-
Track(g.CliObj.Name + "_" + g.CliObj.UsedSC())
366+
Track("conns_" + g.CliObj.UsedSC())
367367
case g.CliObj.Name == "update":
368-
Track(g.CliObj.Name)
369-
case g.CliObj.Name == "run" && telemetryMap["task_type"] != nil:
370-
Track(g.CliObj.Name)
368+
Track("update")
371369
}
372370

373371
return 0

cmd/sling/sling_logic.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ func runTask(cfg *sling.Config) (err error) {
205205
if cfg.Options.StdOut {
206206
telemetryMap["task_tgt_type"] = "stdout"
207207
}
208+
Track("run") // telemetry
208209
}()
209210

210211
// run task
@@ -449,6 +450,7 @@ func updateCLI(c *g.CliSC) (ok bool, err error) {
449450
// Print Progress: https://gist.github.com/albulescu/e61979cc852e4ee8f49c
450451

451452
ok = true
453+
telemetryMap["downloaded"] = false
452454

453455
// get latest version number
454456
newVersion, err := checkLatestVersion()
@@ -459,6 +461,7 @@ func updateCLI(c *g.CliSC) (ok bool, err error) {
459461
return
460462
}
461463

464+
telemetryMap["new_version"] = newVersion
462465
url := ""
463466
if runtime.GOOS == "linux" {
464467
url = "https://files.ocral.org/slingdata.io/dist/sling-linux"

0 commit comments

Comments
 (0)