nolint:revive
(pr *ipnstate.PingResult)
| 869 | |
| 870 | // nolint:revive |
| 871 | func (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. |
| 889 | func (c *Conn) newTelemetryEvent() *proto.TelemetryEvent { |
no test coverage detected