MCPcopy Index your code
hub / github.com/coder/coder / newEvent

Method newEvent

tailnet/telemetry.go:63–81  ·  view source on GitHub ↗

newEvent returns the current telemetry state as an event

()

Source from the content-addressed store, hash-verified

61
62// newEvent returns the current telemetry state as an event
63func (b *TelemetryStore) newEvent() *proto.TelemetryEvent {
64 b.mu.Lock()
65 defer b.mu.Unlock()
66
67 out := &proto.TelemetryEvent{
68 Time: timestamppb.Now(),
69 ClientVersion: buildinfo.Version(),
70 DerpMap: DERPMapToProto(b.cleanDerpMap),
71 LatestNetcheck: b.cleanNetCheck,
72 NodeIdSelf: b.nodeIDSelf,
73 NodeIdRemote: b.nodeIDRemote,
74 HomeDerp: b.homeDerp,
75 Application: b.application,
76 }
77 if b.p2pSetupTime > 0 {
78 out.P2PSetup = durationpb.New(b.p2pSetupTime)
79 }
80 return out
81}
82
83func (b *TelemetryStore) markConnected(ip *netip.Addr, application string) {
84 b.mu.Lock()

Callers 2

newTelemetryEventMethod · 0.80
TestTelemetryStoreFunction · 0.80

Calls 5

VersionFunction · 0.92
DERPMapToProtoFunction · 0.85
NewMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1

TestTelemetryStoreFunction · 0.64