tailscale/wgengine/magicsock
M. J. Fromberger e8be3b7989 wgengine/magicsock,types/logger: add latency logs for initial peer contacts
In order to allow us to measure the performance effects of client-side netmap
caching, both with and without the feature enabled, add logs to record how long
it takes after a client restart or profile switch for the node to establish
contact with peers, relative to the first uncached netmap.

We do this by keeping track of a timestamp when the connection is constructed,
and logging a record for "new" peer contacts that records how long (in
microseconds) it took from the time the peer was recorded as a candidate.  The
message includes whether the contact was via DERP or direct, and whether a
cached netmap was in use at the time.

This builds on and extends the counters from #19699, but here we include new
contacts whether or not a cached netmap is in use, so that we can establish a
baseline for comparison.

Updates #12639
Updates tailscale/projects#27

Change-Id: I4f6d050e221f3881848d05a0425c4a5d1a59294c
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2026-05-29 14:38:06 -07:00
..
blockforever_conn.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
debughttp.go wgengine/magicsock: replace peers slice with peersByID map; add Upsert/RemovePeer 2026-04-22 15:07:11 -07:00
debugknobs_stubs.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
debugknobs.go wgengine/magicsock: make debugNeverDirectUDP influence remote peer decisions 2026-01-30 13:16:46 -08:00
derp_test.go wgengine/magicsock: fix data race in TestSetDERPMapDoReStun 2026-05-21 08:51:50 -07:00
derp.go wgengine/magicsock: restore SetDERPMap signature, add SetDERPMapWithoutReSTUN 2026-04-29 12:46:15 -07:00
disco_atomic_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
disco_atomic.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
discopingpurpose_string.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
endpoint_default.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
endpoint_stub.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
endpoint_test.go magicsock: invalidate endpoint on trust timeout (#19415) 2026-04-15 19:22:07 -07:00
endpoint_tracker_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
endpoint_tracker.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
endpoint.go wgengine/magicsock,types/logger: add latency logs for initial peer contacts 2026-05-29 14:38:06 -07:00
magicsock_default.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
magicsock_linux_test.go cmd/vet: add subtestnames analyzer; fix all existing violations 2026-04-05 15:52:51 -07:00
magicsock_linux.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
magicsock_notplan9.go ipn/localapi: stop logging "broken pipe" errors (#18487) 2026-01-26 16:41:03 -08:00
magicsock_plan9.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
magicsock_test.go control/controlknobs,net/{batching,tstun},wgengine: add nodecaps to disable UDP & TUN GRO/GSO 2026-05-27 17:10:14 -07:00
magicsock.go wgengine/magicsock,types/logger: add latency logs for initial peer contacts 2026-05-29 14:38:06 -07:00
peermap_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
peermap.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
peermtu_darwin.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
peermtu_linux.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
peermtu_stubs.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
peermtu_unix.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
peermtu.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
rebinding_conn.go control/controlknobs,net/{batching,tstun},wgengine: add nodecaps to disable UDP & TUN GRO/GSO 2026-05-27 17:10:14 -07:00
relaymanager_test.go cmd/vet: add subtestnames analyzer; fix all existing violations 2026-04-05 15:52:51 -07:00
relaymanager.go wgengine/magicsock: replace peers slice with peersByID map; add Upsert/RemovePeer 2026-04-22 15:07:11 -07:00