From e71660cd1e5e990476911201bd336dafbaa13bdf Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 25 Feb 2024 20:40:52 +0100 Subject: [PATCH] backup: rename data_added_in_repo statistic to data_added_packed --- doc/075_scripting.rst | 4 ++-- internal/archiver/archiver.go | 2 +- internal/archiver/archiver_test.go | 2 +- internal/restic/snapshot.go | 2 +- internal/ui/backup/json.go | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/075_scripting.rst b/doc/075_scripting.rst index 86851c54b..d51516cbe 100644 --- a/doc/075_scripting.rst +++ b/doc/075_scripting.rst @@ -165,7 +165,7 @@ Summary is the last output line in a successful backup. +---------------------------+---------------------------------------------------------+ | ``data_added`` | Amount of (uncompressed) data added, in bytes | +---------------------------+---------------------------------------------------------+ -| ``data_added_in_repo`` | Amount of data added (after compression), in bytes | +| ``data_added_packed`` | Amount of data added (after compression), in bytes | +---------------------------+---------------------------------------------------------+ | ``total_files_processed`` | Total number of files processed | +---------------------------+---------------------------------------------------------+ @@ -588,7 +588,7 @@ was created. +---------------------------+---------------------------------------------------------+ | ``data_added`` | Amount of (uncompressed) data added, in bytes | +---------------------------+---------------------------------------------------------+ -| ``data_added_in_repo`` | Amount of data added (after compression), in bytes | +| ``data_added_packed`` | Amount of data added (after compression), in bytes | +---------------------------+---------------------------------------------------------+ | ``total_files_processed`` | Total number of files processed | +---------------------------+---------------------------------------------------------+ diff --git a/internal/archiver/archiver.go b/internal/archiver/archiver.go index 39b05d0e6..73cd7a12e 100644 --- a/internal/archiver/archiver.go +++ b/internal/archiver/archiver.go @@ -882,7 +882,7 @@ func (arch *Archiver) Snapshot(ctx context.Context, targets []string, opts Snaps DataBlobs: arch.summary.ItemStats.DataBlobs, TreeBlobs: arch.summary.ItemStats.TreeBlobs, DataAdded: arch.summary.ItemStats.DataSize + arch.summary.ItemStats.TreeSize, - DataAddedInRepo: arch.summary.ItemStats.DataSizeInRepo + arch.summary.ItemStats.TreeSizeInRepo, + DataAddedPacked: arch.summary.ItemStats.DataSizeInRepo + arch.summary.ItemStats.TreeSizeInRepo, TotalFilesProcessed: arch.summary.Files.New + arch.summary.Files.Changed + arch.summary.Files.Unchanged, TotalBytesProcessed: arch.summary.ProcessedBytes, } diff --git a/internal/archiver/archiver_test.go b/internal/archiver/archiver_test.go index ac0ffa6d0..5391a1036 100644 --- a/internal/archiver/archiver_test.go +++ b/internal/archiver/archiver_test.go @@ -1649,7 +1649,7 @@ func checkSnapshotStats(t *testing.T, sn *restic.Snapshot, stat Summary) { bothZeroOrNeither(t, uint64(stat.DataBlobs), uint64(sn.Summary.DataBlobs)) bothZeroOrNeither(t, uint64(stat.TreeBlobs), uint64(sn.Summary.TreeBlobs)) bothZeroOrNeither(t, uint64(stat.DataSize+stat.TreeSize), uint64(sn.Summary.DataAdded)) - bothZeroOrNeither(t, uint64(stat.DataSizeInRepo+stat.TreeSizeInRepo), uint64(sn.Summary.DataAddedInRepo)) + bothZeroOrNeither(t, uint64(stat.DataSizeInRepo+stat.TreeSizeInRepo), uint64(sn.Summary.DataAddedPacked)) } func TestArchiverParent(t *testing.T) { diff --git a/internal/restic/snapshot.go b/internal/restic/snapshot.go index 5ee308879..39ed80627 100644 --- a/internal/restic/snapshot.go +++ b/internal/restic/snapshot.go @@ -45,7 +45,7 @@ type SnapshotSummary struct { DataBlobs int `json:"data_blobs"` TreeBlobs int `json:"tree_blobs"` DataAdded uint64 `json:"data_added"` - DataAddedInRepo uint64 `json:"data_added_in_repo"` + DataAddedPacked uint64 `json:"data_added_packed"` TotalFilesProcessed uint `json:"total_files_processed"` TotalBytesProcessed uint64 `json:"total_bytes_processed"` } diff --git a/internal/ui/backup/json.go b/internal/ui/backup/json.go index b3a8b44a7..a14c7ccec 100644 --- a/internal/ui/backup/json.go +++ b/internal/ui/backup/json.go @@ -175,7 +175,7 @@ func (b *JSONProgress) Finish(snapshotID restic.ID, start time.Time, summary *ar DataBlobs: summary.ItemStats.DataBlobs, TreeBlobs: summary.ItemStats.TreeBlobs, DataAdded: summary.ItemStats.DataSize + summary.ItemStats.TreeSize, - DataAddedInRepo: summary.ItemStats.DataSizeInRepo + summary.ItemStats.TreeSizeInRepo, + DataAddedPacked: summary.ItemStats.DataSizeInRepo + summary.ItemStats.TreeSizeInRepo, TotalFilesProcessed: summary.Files.New + summary.Files.Changed + summary.Files.Unchanged, TotalBytesProcessed: summary.ProcessedBytes, TotalDuration: time.Since(start).Seconds(), @@ -231,7 +231,7 @@ type summaryOutput struct { DataBlobs int `json:"data_blobs"` TreeBlobs int `json:"tree_blobs"` DataAdded uint64 `json:"data_added"` - DataAddedInRepo uint64 `json:"data_added_in_repo"` + DataAddedPacked uint64 `json:"data_added_packed"` TotalFilesProcessed uint `json:"total_files_processed"` TotalBytesProcessed uint64 `json:"total_bytes_processed"` TotalDuration float64 `json:"total_duration"` // in seconds