mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
7c386ca6d2
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> |
||
---|---|---|
.. | ||
label_string.go | ||
sockstats_noop.go | ||
sockstats_tsgo_darwin.go | ||
sockstats_tsgo_test.go | ||
sockstats_tsgo.go | ||
sockstats.go |