"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
accounting: Fix elapsed time not show actual time since beginning
Chaitanya Bankanhal8913679d8871
diff --git a/fs/accounting/stats.go b/fs/accounting/stats.goindex 55734e03e..84eaafc63 100644--- a/fs/accounting/stats.go+++ b/fs/accounting/stats.go@@ -16,6 +16,8 @@ import (// MaxCompletedTransfers specifies maximum number of completed transfers in startedTransfers listvar MaxCompletedTransfers = 100+var startTime = time.Now()+// StatsInfo accounts all transferstype StatsInfo struct {mu sync.RWMutex@@ -66,7 +68,8 @@ func (s *StatsInfo) RemoteStats() (out rc.Params, err error) {out["transfers"] = s.transfersout["deletes"] = s.deletesout["renames"] = s.renames- out["elapsedTime"] = s.totalDuration().Seconds()+ out["transferTime"] = s.totalDuration().Seconds()+ out["elapsedTime"] = time.Since(startTime).Seconds()s.mu.RUnlock()if !s.checking.empty() {var c []string@@ -248,9 +251,10 @@ func (s *StatsInfo) String() string {s.mu.RLock()+ elapsedTime := time.Since(startTime)+ elapsedTimeSecondsOnly := elapsedTime.Truncate(time.Second/10) % time.Minutedt := s.totalDuration()dtSeconds := dt.Seconds()- dtSecondsOnly := dt.Truncate(time.Second/10) % time.Minutespeed := 0.0if dt > 0 {speed = float64(s.bytes) / dtSeconds@@ -332,7 +336,7 @@ func (s *StatsInfo) String() string {_, _ = fmt.Fprintf(buf, "Transferred: %10d / %d, %s\n",s.transfers, totalTransfer, percent(s.transfers, totalTransfer))}- _, _ = fmt.Fprintf(buf, "Elapsed time: %10ss\n", strings.TrimRight(dt.Truncate(time.Minute).String(), "0s")+fmt.Sprintf("%.1f", dtSecondsOnly.Seconds()))+ _, _ = fmt.Fprintf(buf, "Elapsed time: %10ss\n", strings.TrimRight(elapsedTime.Truncate(time.Minute).String(), "0s")+fmt.Sprintf("%.1f", elapsedTimeSecondsOnly.Seconds()))}// checking and transferring have their own locking so unlockdiff --git a/fs/accounting/stats_groups.go b/fs/accounting/stats_groups.goindex d59576d9b..6bcd1ea20 100644--- a/fs/accounting/stats_groups.go+++ b/fs/accounting/stats_groups.go@@ -95,6 +95,7 @@ Returns the following values:"transfers": number of transferred files,"deletes" : number of deleted files,"renames" : number of renamed files,+ "transferTime" : total time spent on running jobs,"elapsedTime": time in seconds since the start of the process,"lastError": last occurred error,"transferring": an array of currently active file transfers: