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

Method sendPingTelemetry

tailnet/conn.go:871–886  ·  view source on GitHub ↗

nolint:revive

(pr *ipnstate.PingResult)

Source from the content-addressed store, hash-verified

869
870// nolint:revive
871func (c *Conn) sendPingTelemetry(pr *ipnstate.PingResult) {
872 if c.telemetrySink == nil {
873 return
874 }
875 e := c.newTelemetryEvent()
876
877 latency := durationpb.New(time.Duration(pr.LatencySeconds * float64(time.Second)))
878 if pr.Endpoint != "" {
879 e.P2PLatency = latency
880 e.P2PEndpoint = c.telemetryStore.toEndpoint(pr.Endpoint)
881 } else {
882 e.DerpLatency = latency
883 }
884 e.Status = proto.TelemetryEvent_CONNECTED
885 c.sendTelemetryBackground(e)
886}
887
888// The returned telemetry event will not have it's status set.
889func (c *Conn) newTelemetryEvent() *proto.TelemetryEvent {

Callers 1

PingMethod · 0.95

Implementers 1

fakeConnvpn/tunnel_internal_test.go

Calls 5

newTelemetryEventMethod · 0.95
DurationMethod · 0.80
toEndpointMethod · 0.80
NewMethod · 0.65

Tested by

no test coverage detected