"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
stats: fix missing StatsInfo fields in the computation of the group sum
Carlo Mion7b7d780fffd8
diff --git a/fs/accounting/stats.go b/fs/accounting/stats.goindex fe1fdf11c..b4b32a8ee 100644--- a/fs/accounting/stats.go+++ b/fs/accounting/stats.go@@ -24,6 +24,8 @@ const (var MaxCompletedTransfers = 100// StatsInfo accounts all transfers+// N.B.: if this struct is modified, please remember to also update sum() function in stats_groups+// to correctly count the updated fieldstype StatsInfo struct {mu sync.RWMutexctx context.Contextdiff --git a/fs/accounting/stats_groups.go b/fs/accounting/stats_groups.goindex 400c72924..28548cfc9 100644--- a/fs/accounting/stats_groups.go+++ b/fs/accounting/stats_groups.go@@ -359,23 +359,31 @@ func (sg *statsGroups) sum(ctx context.Context) *StatsInfo {{sum.bytes += stats.bytessum.errors += stats.errors+ if sum.lastError == nil && stats.lastError != nil {+ sum.lastError = stats.lastError+ }sum.fatalError = sum.fatalError || stats.fatalErrorsum.retryError = sum.retryError || stats.retryError+ if stats.retryAfter.After(sum.retryAfter) {+ // Update the retryAfter field only if it is a later date than the current one in the sum+ sum.retryAfter = stats.retryAfter+ }sum.checks += stats.checks+ sum.checking.merge(stats.checking)+ sum.checkQueue += stats.checkQueue+ sum.checkQueueSize += stats.checkQueueSizesum.transfers += stats.transfers+ sum.transferring.merge(stats.transferring)+ sum.transferQueueSize += stats.transferQueueSize+ sum.renames += stats.renames+ sum.renameQueue += stats.renameQueue+ sum.renameQueueSize += stats.renameQueueSizesum.deletes += stats.deletessum.deletedDirs += stats.deletedDirs- sum.renames += stats.renames- sum.checking.merge(stats.checking)- sum.transferring.merge(stats.transferring)sum.inProgress.merge(stats.inProgress)- if sum.lastError == nil && stats.lastError != nil {- sum.lastError = stats.lastError- }sum.startedTransfers = append(sum.startedTransfers, stats.startedTransfers...)- sum.transferQueueSize += stats.transferQueueSize- sum.oldDuration += stats.oldDurationsum.oldTimeRanges = append(sum.oldTimeRanges, stats.oldTimeRanges...)+ sum.oldDuration += stats.oldDurationstats.average.mu.Lock()sum.average.speed += stats.average.speedstats.average.mu.Unlock()