| 540 | } |
| 541 | |
| 542 | func recordListTelemetry(opts *ListOptions, skillCount int) { |
| 543 | if opts.Telemetry == nil { |
| 544 | return |
| 545 | } |
| 546 | |
| 547 | agentHosts := opts.Agent |
| 548 | if agentHosts == "" { |
| 549 | agentHosts = "all" |
| 550 | } |
| 551 | scope := opts.Scope |
| 552 | if scope == "" { |
| 553 | scope = "all" |
| 554 | } |
| 555 | customDir := "false" |
| 556 | if opts.Dir != "" { |
| 557 | customDir = "true" |
| 558 | scope = scopeCustom |
| 559 | } |
| 560 | format := "table" |
| 561 | if opts.Exporter != nil { |
| 562 | format = "json" |
| 563 | } |
| 564 | |
| 565 | opts.Telemetry.Record(ghtelemetry.Event{ |
| 566 | Type: "skill_list", |
| 567 | Dimensions: ghtelemetry.Dimensions{ |
| 568 | "agent_hosts": agentHosts, |
| 569 | "custom_dir": customDir, |
| 570 | "format": format, |
| 571 | "scope": scope, |
| 572 | }, |
| 573 | Measures: ghtelemetry.Measures{ |
| 574 | "skill_count": int64(skillCount), |
| 575 | }, |
| 576 | }) |
| 577 | } |