mirror of
https://github.com/restic/restic.git
synced 2026-11-05 14:59:21 +00:00
restic copy - add statistics counters
cmd/restic/cmd_copy.go: add function copyStats() and call it before the actual copying starts. changelog/unreleased/pull-5319: rephrased wording of the statistics counters.
This commit is contained in:
1 parent
90ac3efa88
commit
25611f4628
2 files changed
+6
-4
No files matched your search
@@ -251,7 +251,9 @@ func copyTree(ctx context.Context, srcRepo restic.Repository, dstRepo restic.Rep
|
||||
return nil
|
||||
}
|
||||
|
||||
// copyStats: print statistics for the blobs to be copied
|
||||
func copyStats(srcRepo restic.Repository, copyBlobs restic.BlobSet, packList restic.IDSet, printer progress.Printer) {
|
||||
|
||||
// count and size
|
||||
countBlobs := 0
|
||||
sizeBlobs := uint64(0)
|
||||
@@ -259,10 +261,10 @@ func copyStats(srcRepo restic.Repository, copyBlobs restic.BlobSet, packList res
|
||||
for _, blob := range srcRepo.LookupBlob(blob.Type, blob.ID) {
|
||||
countBlobs++
|
||||
sizeBlobs += uint64(blob.Length)
|
||||
break
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
printer.V(" %7d all blobs with a size %11s in %7d packfiles\n",
|
||||
printer.V(" copy %d blobs with disk size %s in %d packfiles\n",
|
||||
countBlobs, ui.FormatBytes(uint64(sizeBlobs)), len(packList))
|
||||
}
|
||||
Reference in new issue
Block a user