MCPcopy Index your code
hub / github.com/cli/cli / recordListTelemetry

Function recordListTelemetry

pkg/cmd/skills/list/list.go:548–583  ·  view source on GitHub ↗
(opts *ListOptions, skillCount int)

Source from the content-addressed store, hash-verified

546}
547
548func 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}

Callers 1

listRunFunction · 0.85

Calls 1

RecordMethod · 0.65

Tested by

no test coverage detected