mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 23:07:44 +00:00
net/sockstats: return early if no radio period length
Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
parent
75784e10e2
commit
22680a11ae
@ -332,6 +332,9 @@ func (rm *radioMonitor) radioHighPercent() int64 {
|
||||
now := rm.now().Unix()
|
||||
var periodLength int64 = radioSampleSize
|
||||
if t := now - rm.startTime; t < periodLength {
|
||||
if t <= 0 {
|
||||
return 0
|
||||
}
|
||||
periodLength = t
|
||||
}
|
||||
periodStart := now - periodLength // start of current reporting period
|
||||
|
Loading…
x
Reference in New Issue
Block a user