mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-28 14:51:32 +01:00
wgengine/magicsock: add clientmetrics for RX bytes by af & conn type (#17512)
Updates tailscale/corp#33206 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
parent
d72370a6eb
commit
adf308a064
@ -803,6 +803,11 @@ func registerMetrics(reg *usermetric.Registry) *metrics {
|
|||||||
metricRecvDataPacketsDERP.Register(&m.inboundPacketsDERPTotal)
|
metricRecvDataPacketsDERP.Register(&m.inboundPacketsDERPTotal)
|
||||||
metricRecvDataPacketsPeerRelayIPv4.Register(&m.inboundPacketsPeerRelayIPv4Total)
|
metricRecvDataPacketsPeerRelayIPv4.Register(&m.inboundPacketsPeerRelayIPv4Total)
|
||||||
metricRecvDataPacketsPeerRelayIPv6.Register(&m.inboundPacketsPeerRelayIPv6Total)
|
metricRecvDataPacketsPeerRelayIPv6.Register(&m.inboundPacketsPeerRelayIPv6Total)
|
||||||
|
metricRecvDataBytesIPv4.Register(&m.inboundBytesIPv4Total)
|
||||||
|
metricRecvDataBytesIPv6.Register(&m.inboundBytesIPv6Total)
|
||||||
|
metricRecvDataBytesDERP.Register(&m.inboundBytesDERPTotal)
|
||||||
|
metricRecvDataBytesPeerRelayIPv4.Register(&m.inboundBytesPeerRelayIPv4Total)
|
||||||
|
metricRecvDataBytesPeerRelayIPv6.Register(&m.inboundBytesPeerRelayIPv6Total)
|
||||||
metricSendUDP.Register(&m.outboundPacketsIPv4Total)
|
metricSendUDP.Register(&m.outboundPacketsIPv4Total)
|
||||||
metricSendUDP.Register(&m.outboundPacketsIPv6Total)
|
metricSendUDP.Register(&m.outboundPacketsIPv6Total)
|
||||||
metricSendDERP.Register(&m.outboundPacketsDERPTotal)
|
metricSendDERP.Register(&m.outboundPacketsDERPTotal)
|
||||||
@ -846,6 +851,11 @@ func deregisterMetrics() {
|
|||||||
metricRecvDataPacketsDERP.UnregisterAll()
|
metricRecvDataPacketsDERP.UnregisterAll()
|
||||||
metricRecvDataPacketsPeerRelayIPv4.UnregisterAll()
|
metricRecvDataPacketsPeerRelayIPv4.UnregisterAll()
|
||||||
metricRecvDataPacketsPeerRelayIPv6.UnregisterAll()
|
metricRecvDataPacketsPeerRelayIPv6.UnregisterAll()
|
||||||
|
metricRecvDataBytesIPv4.UnregisterAll()
|
||||||
|
metricRecvDataBytesIPv6.UnregisterAll()
|
||||||
|
metricRecvDataBytesDERP.UnregisterAll()
|
||||||
|
metricRecvDataBytesPeerRelayIPv4.UnregisterAll()
|
||||||
|
metricRecvDataBytesPeerRelayIPv6.UnregisterAll()
|
||||||
metricSendUDP.UnregisterAll()
|
metricSendUDP.UnregisterAll()
|
||||||
metricSendDERP.UnregisterAll()
|
metricSendDERP.UnregisterAll()
|
||||||
metricSendPeerRelay.UnregisterAll()
|
metricSendPeerRelay.UnregisterAll()
|
||||||
@ -3935,6 +3945,13 @@ var (
|
|||||||
metricRecvDataPacketsPeerRelayIPv4 = clientmetric.NewAggregateCounter("magicsock_recv_data_peer_relay_ipv4")
|
metricRecvDataPacketsPeerRelayIPv4 = clientmetric.NewAggregateCounter("magicsock_recv_data_peer_relay_ipv4")
|
||||||
metricRecvDataPacketsPeerRelayIPv6 = clientmetric.NewAggregateCounter("magicsock_recv_data_peer_relay_ipv6")
|
metricRecvDataPacketsPeerRelayIPv6 = clientmetric.NewAggregateCounter("magicsock_recv_data_peer_relay_ipv6")
|
||||||
|
|
||||||
|
// Data bytes (non-disco)
|
||||||
|
metricRecvDataBytesDERP = clientmetric.NewAggregateCounter("magicsock_recv_data_bytes_derp")
|
||||||
|
metricRecvDataBytesIPv4 = clientmetric.NewAggregateCounter("magicsock_recv_data_bytes_ipv4")
|
||||||
|
metricRecvDataBytesIPv6 = clientmetric.NewAggregateCounter("magicsock_recv_data_bytes_ipv6")
|
||||||
|
metricRecvDataBytesPeerRelayIPv4 = clientmetric.NewAggregateCounter("magicsock_recv_data_bytes_peer_relay_ipv4")
|
||||||
|
metricRecvDataBytesPeerRelayIPv6 = clientmetric.NewAggregateCounter("magicsock_recv_data_bytes_peer_relay_ipv6")
|
||||||
|
|
||||||
// Disco packets
|
// Disco packets
|
||||||
metricSendDiscoUDP = clientmetric.NewCounter("magicsock_disco_send_udp")
|
metricSendDiscoUDP = clientmetric.NewCounter("magicsock_disco_send_udp")
|
||||||
metricSendDiscoDERP = clientmetric.NewCounter("magicsock_disco_send_derp")
|
metricSendDiscoDERP = clientmetric.NewCounter("magicsock_disco_send_derp")
|
||||||
|
|||||||
@ -1302,6 +1302,8 @@ func assertConnStatsAndUserMetricsEqual(t *testing.T, ms *magicStack) {
|
|||||||
c.Assert(metricSendUDP.Value(), qt.Equals, metricIPv4TxPackets*2)
|
c.Assert(metricSendUDP.Value(), qt.Equals, metricIPv4TxPackets*2)
|
||||||
c.Assert(metricRecvDataPacketsIPv4.Value(), qt.Equals, metricIPv4RxPackets*2)
|
c.Assert(metricRecvDataPacketsIPv4.Value(), qt.Equals, metricIPv4RxPackets*2)
|
||||||
c.Assert(metricRecvDataPacketsDERP.Value(), qt.Equals, metricDERPRxPackets*2)
|
c.Assert(metricRecvDataPacketsDERP.Value(), qt.Equals, metricDERPRxPackets*2)
|
||||||
|
c.Assert(metricRecvDataBytesIPv4.Value(), qt.Equals, metricIPv4RxBytes*2)
|
||||||
|
c.Assert(metricRecvDataBytesDERP.Value(), qt.Equals, metricDERPRxBytes*2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// tests that having a endpoint.String prevents wireguard-go's
|
// tests that having a endpoint.String prevents wireguard-go's
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user