From 240c15883f7b9ac58d107bdf7939565cee670b6f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 13 Feb 2019 19:06:20 +0000 Subject: [PATCH] accounting: fix total ETA when --stats-unit bits is in effect --- fs/accounting/stats.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/accounting/stats.go b/fs/accounting/stats.go index 56010fbeb..565d16327 100644 --- a/fs/accounting/stats.go +++ b/fs/accounting/stats.go @@ -201,8 +201,9 @@ func (s *StatsInfo) String() string { } dtRounded := dt - (dt % (time.Second / 10)) + displaySpeed := speed if fs.Config.DataRateUnit == "bits" { - speed = speed * 8 + displaySpeed *= 8 } var ( @@ -235,7 +236,7 @@ func (s *StatsInfo) String() string { fs.SizeSuffix(s.bytes), fs.SizeSuffix(totalSize).Unit("Bytes"), percent(s.bytes, totalSize), - fs.SizeSuffix(speed).Unit(strings.Title(fs.Config.DataRateUnit)+"/s"), + fs.SizeSuffix(displaySpeed).Unit(strings.Title(fs.Config.DataRateUnit)+"/s"), etaString(currentSize, totalSize, speed), xfrchkString, )