if the BPS is less than 1, report 0 (#4467)

This commit is contained in:
Dhruv Sringari
2022-10-05 14:34:18 -07:00
committed by GitHub
parent 3cbd40c618
commit 69713346eb
+7
View File
@@ -223,6 +223,13 @@ func emitStats(s *stats, ch chan Stats) (cancel func()) {
smoothedFetchBPS = curFetchedBPS + weight*(newFetchedBPS-curFetchedBPS)
}
if smoothedSendBPS < 1 {
smoothedSendBPS = 0
}
if smoothedFetchBPS < 1 {
smoothedFetchBPS = 0
}
atomic.StoreUint64(&s.sendBytesPerSec, math.Float64bits(smoothedSendBPS))
atomic.StoreUint64(&s.fetchedSourceBytesPerSec, math.Float64bits(smoothedFetchBPS))