Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

accounting: fix total ETA when --stats-unit bits is in effect

Nick Craig-Wood240c15883f7b
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,
)