From ad80bb3735b0f82aa50e3c715a089116b36e49f6 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Fri, 9 Jul 2021 16:39:21 +0200 Subject: [PATCH] status: byteprogresshistory: disable averaging as workaround for #497 refs #497 --- client/status/viewmodel/bytesprogresshistory.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client/status/viewmodel/bytesprogresshistory.go b/client/status/viewmodel/bytesprogresshistory.go index ae2bda7..57a10d6 100644 --- a/client/status/viewmodel/bytesprogresshistory.go +++ b/client/status/viewmodel/bytesprogresshistory.go @@ -11,7 +11,6 @@ type bytesProgressHistory struct { last *byteProgressMeasurement // pointer as poor man's optional changeCount int lastChange time.Time - bpsAvg float64 } func (p *bytesProgressHistory) Update(currentVal int64) (bytesPerSecondAvg int64, changeCount int) { @@ -38,11 +37,8 @@ func (p *bytesProgressHistory) Update(currentVal int64) (bytesPerSecondAvg int64 deltaT := time.Since(p.last.time) rate := float64(deltaV) / deltaT.Seconds() - factor := 0.3 - p.bpsAvg = (1-factor)*p.bpsAvg + factor*rate - p.last.time = time.Now() p.last.val = currentVal - return int64(p.bpsAvg), p.changeCount + return int64(rate), p.changeCount }