MCPcopy Create free account
hub / github.com/cli/cli / recordListTelemetry

Function recordListTelemetry

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

Source from the content-addressed store, hash-verified

540}
541
542func 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}

Callers 1

listRunFunction · 0.85

Calls 1

RecordMethod · 0.65

Tested by

no test coverage detected