repository: add PackBlob.UncompressedCiphertextLength()

This commit is contained in:
Michael Eischer
2026-06-05 13:18:59 +02:00
parent 952b310d62
commit b94ef4831d
5 changed files with 16 additions and 3 deletions
+2 -3
View File
@@ -9,7 +9,6 @@ import (
"strings"
"github.com/restic/chunker"
"github.com/restic/restic/internal/crypto"
"github.com/restic/restic/internal/data"
"github.com/restic/restic/internal/global"
"github.com/restic/restic/internal/repository"
@@ -162,10 +161,10 @@ func runStats(ctx context.Context, opts StatsOptions, gopts global.Options, args
}
stats.TotalSize += uint64(pbs[0].CiphertextLength())
if repo.Config().Version >= 2 {
stats.TotalUncompressedSize += uint64(crypto.CiphertextLength(int(pbs[0].PlaintextLength())))
stats.TotalUncompressedSize += uint64(pbs[0].UncompressedCiphertextLength())
if pbs[0].IsCompressed() {
stats.TotalCompressedBlobsSize += uint64(pbs[0].CiphertextLength())
stats.TotalCompressedBlobsUncompressedSize += uint64(crypto.CiphertextLength(int(pbs[0].PlaintextLength())))
stats.TotalCompressedBlobsUncompressedSize += uint64(pbs[0].UncompressedCiphertextLength())
}
}
stats.TotalBlobCount++