tailscale/net
Will Norris 7c386ca6d2 net/sockstats: fix calculation of radio power usage
When splitting the radio monitor usage array, we were splitting at now %
3600 to get values into chronological order.  This caused the value for
the final second to be included at the beginning of the ordered slice
rather than the end.  If there was activity during that final second, an
extra five seconds of high power usage would get recorded in some cases.
This could result in a final calculation of greater than 100% usage.

This corrects that by splitting values at (now+1 % 3600).

This also simplifies the percentage calculation by always rounding
values down, which is sufficient for our usage.

Signed-off-by: Will Norris <will@tailscale.com>
2023-04-19 13:18:02 -07:00
..
art net/art: skip tests on CI for now 2023-04-14 10:24:38 -07:00
connstats net/connstats: exclude traffic with internal Tailscale service (#7904) 2023-04-17 14:24:29 -07:00
dns various: add golangci-lint, fix issues (#7905) 2023-04-17 18:38:24 -04:00
dnscache tstest: add method to Replace values for tests 2023-03-03 17:02:33 -08:00
dnsfallback net/dnsfallback: more explicitly pass through logf function 2023-04-17 12:06:23 -07:00
flowtrack all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces net/netns: don't log errors when we can't get the default route on Darwin 2023-04-18 09:57:15 -07:00
memnet net/memnet: rename from net/nettest 2023-01-30 13:03:32 -08:00
netaddr all: update copyright and license headers 2023-01-27 15:36:29 -08:00
netcheck net/netcheck: reenable TestNodeAddrResolve on Windows 2023-04-17 12:41:56 -04:00
neterror net/neterror, wgengine/magicsock: use UDP GSO and GRO on Linux (#7791) 2023-04-04 16:32:16 -07:00
netknob all: update copyright and license headers 2023-01-27 15:36:29 -08:00
netns net/netns: don't log errors when we can't get the default route on Darwin 2023-04-18 09:57:15 -07:00
netstat net/{netns,netstat}: use new x/sys/cpu.IsBigEndian 2023-02-02 07:41:49 -08:00
netutil all: replace /kb/ links with /s/ equivalents 2023-03-13 14:21:15 -07:00
packet net, wgengine/capture: encode NAT addresses in pcap stream 2023-04-06 13:26:00 -07:00
ping all: update copyright and license headers 2023-01-27 15:36:29 -08:00
portmapper various: add golangci-lint, fix issues (#7905) 2023-04-17 18:38:24 -04:00
proxymux all: update copyright and license headers 2023-01-27 15:36:29 -08:00
routetable net/routetable: include unknown flags in the routetable doctor output 2023-02-10 15:54:31 -08:00
socks5 net/socks5: add password auth support 2023-03-05 14:08:34 -08:00
sockstats net/sockstats: fix calculation of radio power usage 2023-04-19 13:18:02 -07:00
speedtest all: update copyright and license headers 2023-01-27 15:36:29 -08:00
stun wgengine/magicsock, types/nettype, etc: finish ReadFromUDPAddrPort netip migration 2023-04-15 13:40:15 -07:00
tlsdial health, net/tlsdial: add healthcheck for self-signed cert 2023-02-01 23:17:41 -05:00
tsaddr all: replace /kb/ links with /s/ equivalents 2023-03-13 14:21:15 -07:00
tsdial various: add golangci-lint, fix issues (#7905) 2023-04-17 18:38:24 -04:00
tshttpproxy net/tshttpproxy: don't proxy through ourselves 2023-03-29 17:09:45 -04:00
tstun tailcfg: make SelfNodeV4MasqAddrForThisPeer a pointer 2023-04-13 11:28:33 -07:00
wsconn all: update copyright and license headers 2023-01-27 15:36:29 -08:00