Merge pull request #22130 from junkerderprovinz/fix/issue-22112

stats: keep progress counters across snapshots
This commit is contained in:
Michael Eischer authored and GitHub committed 2026-11-15 20:01:16 +01:00
commit 335d7e38aa
3 files changed
+13 -6

No files matched your search

-3
View File
@@ -88,7 +88,4 @@ func (p *Progress) ProcessSnapshot() {
defer p.m.Unlock()
p.processedSnapshotCount++
p.processedFileCount = 0
p.processedBlobCount = 0
p.processedSize = 0
}
+3 -3
View File
@@ -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) {