mirror of
https://github.com/restic/restic.git
synced 2026-11-21 13:02:42 +00:00
stats: keep progress counters across snapshots
The file, blob and size counters were reset for every snapshot, so the progress line only reflected the last processed snapshot. Co-authored-by: Winfried Plappert <18740761+wplapper@users.noreply.github.com>
This commit is contained in:
1 parent
dd09b6bd01
commit
84c2d0223f
3 files changed
+12
-6
No files matched your search
@@ -24,14 +24,14 @@ func TestStatsProgress(t *testing.T) {
|
||||
|
||||
progress.ProcessSnapshot()
|
||||
progress.printProgress(10*time.Second, false)
|
||||
rtest.Equals(t, []string{"[0:10] 50.00% 2 / 2 snapshots, 0 B"}, term.Output)
|
||||
rtest.Equals(t, []string{"[0:10] 50.00% 2 / 2 snapshots, 1 files, 2 blobs, 3 B"}, term.Output)
|
||||
|
||||
progress.Update(4, 5, 6)
|
||||
progress.printProgress(15*time.Second, false)
|
||||
rtest.Equals(t, []string{"[0:15] 50.00% 2 / 2 snapshots, 4 files, 5 blobs, 6 B"}, term.Output)
|
||||
rtest.Equals(t, []string{"[0:15] 50.00% 2 / 2 snapshots, 5 files, 7 blobs, 9 B"}, term.Output)
|
||||
|
||||
progress.printProgress(20*time.Second, true)
|
||||
rtest.Equals(t, []string{"[0:20] 100.00% 2 / 2 snapshots, 4 files, 5 blobs, 6 B"}, term.Output)
|
||||
rtest.Equals(t, []string{"[0:20] 100.00% 2 / 2 snapshots, 5 files, 7 blobs, 9 B"}, term.Output)
|
||||
}
|
||||
|
||||
func TestStatsProgressJSON(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user