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

Method RecordTelemetry

internal/attachments/flags.go:44–59  ·  view source on GitHub ↗

RecordTelemetry records how many attachment flags were provided.

(command string, recorder ghtelemetry.CommandRecorder)

Source from the content-addressed store, hash-verified

42
43// RecordTelemetry records how many attachment flags were provided.
44func (f *Flag) RecordTelemetry(command string, recorder ghtelemetry.CommandRecorder) {
45 if recorder == nil || !f.Changed() {
46 return
47 }
48
49 recorder.SetSampleRate(ghtelemetry.SAMPLE_ALL)
50 recorder.Record(ghtelemetry.Event{
51 Type: "attachment_invocation",
52 Dimensions: ghtelemetry.Dimensions{
53 "command": command,
54 },
55 Measures: ghtelemetry.Measures{
56 "attach_count": int64(len(f.values)),
57 },
58 })
59}
60
61// UserAssets validates the files named by the attachment flag, keeping them in
62// the order they were written. It returns nothing when the flag was not passed.

Callers 7

NewCmdCommentFunction · 0.80
NewCmdCreateFunction · 0.80
NewCmdEditFunction · 0.80
NewCmdCommentFunction · 0.80
NewCmdCreateFunction · 0.80
NewCmdEditFunction · 0.80
TestFlagRecordTelemetryFunction · 0.80

Calls 3

ChangedMethod · 0.95
SetSampleRateMethod · 0.65
RecordMethod · 0.65

Tested by 1

TestFlagRecordTelemetryFunction · 0.64