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