mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-19 21:23:58 +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()
|
now := rm.now().Unix()
|
||||||
var periodLength int64 = radioSampleSize
|
var periodLength int64 = radioSampleSize
|
||||||
if t := now - rm.startTime; t < periodLength {
|
if t := now - rm.startTime; t < periodLength {
|
||||||
|
if t <= 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
periodLength = t
|
periodLength = t
|
||||||
}
|
}
|
||||||
periodStart := now - periodLength // start of current reporting period
|
periodStart := now - periodLength // start of current reporting period
|
||||||
|
Loading…
x
Reference in New Issue
Block a user