mirror of
https://github.com/restic/restic.git
synced 2026-05-19 08:35:23 +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:
committed by
Michael Eischer
parent
90ac3efa88
commit
25611f4628
@@ -1,8 +1,8 @@
|
||||
Enhancement: add more status counters to `restic copy`
|
||||
|
||||
`restic copy` now produces more status counters in text format. The new counters
|
||||
are the number of tree/data blobs, their sizes and the number of packfiles
|
||||
they are attachedc to.
|
||||
are the number of blobs to copy, their size on disk and the number of packfiles
|
||||
used from the source repository.
|
||||
|
||||
https://github.com/restic/restic/issues/5175
|
||||
https://github.com/restic/restic/pull/5319
|
||||
|
||||
@@ -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