SendConnectedTelemetry should be called when connection to a peer with the given IP is established.
(ip netip.Addr, application string)
| 838 | |
| 839 | // SendConnectedTelemetry should be called when connection to a peer with the given IP is established. |
| 840 | func (c *Conn) SendConnectedTelemetry(ip netip.Addr, application string) { |
| 841 | if c.telemetrySink == nil { |
| 842 | return |
| 843 | } |
| 844 | c.telemetryStore.markConnected(&ip, application) |
| 845 | e := c.newTelemetryEvent() |
| 846 | e.Status = proto.TelemetryEvent_CONNECTED |
| 847 | e.ConnectionSetup = durationpb.New(time.Since(c.createdAt)) |
| 848 | c.sendTelemetryBackground(e) |
| 849 | } |
| 850 | |
| 851 | func (c *Conn) SendDisconnectedTelemetry() { |
| 852 | if c.telemetrySink == nil { |
no test coverage detected