Files
netbird/client
Zoltan Papp b7a2fe6a60 [iface] Cache WireGuard stats to collapse per-peer device dumps
Each peer runs a WGWatcher that polls GetStats(), and every call dumps
the whole device, so with N peers the watchers perform O(N) full dumps
per poll cycle (O(N^2) work) while each keeps only its own peer's entry.

Wrap the kernel and userspace configurer GetStats() in a short-TTL cache
with singleflight: the staggered per-peer calls share a single device
dump per window and concurrent misses collapse into one dump. The kernel
and userspace WireGuard APIs have no per-peer stats query (a get always
returns the whole device), so a shared cached snapshot avoids the
repeated full dumps.
2026-07-01 22:12:55 +02:00
..
2023-05-18 19:47:36 +02:00