mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 23:07:44 +00:00
wgengine/magicsock: add metrics for sent disco messages
We only tracked the transport type (UDP vs DERP), not what they were. Change-Id: Ia4430c1c53afd4634e2d9893d96751a885d77955 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
81bc812402
commit
c7f5bc0f69
@ -1801,6 +1801,14 @@ func (c *Conn) sendDiscoMessage(dst netaddr.IPPort, dstKey key.NodePublic, dstDi
|
||||
} else {
|
||||
metricSentDiscoUDP.Add(1)
|
||||
}
|
||||
switch m.(type) {
|
||||
case *disco.Ping:
|
||||
metricSentDiscoPing.Add(1)
|
||||
case *disco.Pong:
|
||||
metricSentDiscoPong.Add(1)
|
||||
case *disco.CallMeMaybe:
|
||||
metricSentDiscoCallMeMaybe.Add(1)
|
||||
}
|
||||
} else if err == nil {
|
||||
// Can't send. (e.g. no IPv6 locally)
|
||||
} else {
|
||||
@ -4047,13 +4055,16 @@ func (di *discoInfo) setNodeKey(nk key.NodePublic) {
|
||||
metricRecvDataIPv6 = clientmetric.NewCounter("magicsock_recv_data_ipv6")
|
||||
|
||||
// Disco packets
|
||||
metricSendDiscoUDP = clientmetric.NewCounter("magicsock_disco_send_udp")
|
||||
metricSendDiscoDERP = clientmetric.NewCounter("magicsock_disco_send_derp")
|
||||
metricSentDiscoUDP = clientmetric.NewCounter("magicsock_disco_sent_udp")
|
||||
metricSentDiscoDERP = clientmetric.NewCounter("magicsock_disco_sent_derp")
|
||||
metricRecvDiscoBadPeer = clientmetric.NewCounter("magicsock_disco_recv_bad_peer")
|
||||
metricRecvDiscoBadKey = clientmetric.NewCounter("magicsock_disco_recv_bad_key")
|
||||
metricRecvDiscoBadParse = clientmetric.NewCounter("magicsock_disco_recv_bad_parse")
|
||||
metricSendDiscoUDP = clientmetric.NewCounter("magicsock_disco_send_udp")
|
||||
metricSendDiscoDERP = clientmetric.NewCounter("magicsock_disco_send_derp")
|
||||
metricSentDiscoUDP = clientmetric.NewCounter("magicsock_disco_sent_udp")
|
||||
metricSentDiscoDERP = clientmetric.NewCounter("magicsock_disco_sent_derp")
|
||||
metricSentDiscoPing = clientmetric.NewCounter("magicsock_disco_sent_ping")
|
||||
metricSentDiscoPong = clientmetric.NewCounter("magicsock_disco_sent_pong")
|
||||
metricSentDiscoCallMeMaybe = clientmetric.NewCounter("magicsock_disco_sent_callmemaybe")
|
||||
metricRecvDiscoBadPeer = clientmetric.NewCounter("magicsock_disco_recv_bad_peer")
|
||||
metricRecvDiscoBadKey = clientmetric.NewCounter("magicsock_disco_recv_bad_key")
|
||||
metricRecvDiscoBadParse = clientmetric.NewCounter("magicsock_disco_recv_bad_parse")
|
||||
|
||||
metricRecvDiscoUDP = clientmetric.NewCounter("magicsock_disco_recv_udp")
|
||||
metricRecvDiscoDERP = clientmetric.NewCounter("magicsock_disco_recv_derp")
|
||||
|
Loading…
x
Reference in New Issue
Block a user