From 5f43287feb7c5b909691fbdcff5ea4c635bb34ff Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Tue, 2 May 2023 14:53:37 -0700 Subject: [PATCH] Add periodic log message for loading items during restore (#3282) #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [x] :robot: Supportability/Tests - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup #### Issue(s) * #### Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/kopia/wrapper.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/internal/kopia/wrapper.go b/src/internal/kopia/wrapper.go index 6f7dd69eb..9b20f5151 100644 --- a/src/internal/kopia/wrapper.go +++ b/src/internal/kopia/wrapper.go @@ -413,6 +413,7 @@ func (w Wrapper) ProduceRestoreCollections( } var ( + loadCount int // Maps short ID of parent path to data collection for that folder. cols = map[string]*kopiaDataCollection{} el = errs.Local() @@ -451,6 +452,11 @@ func (w Wrapper) ProduceRestoreCollections( } c.streams = append(c.streams, ds) + + loadCount++ + if loadCount%1000 == 0 { + logger.Ctx(ctx).Infow("loading items from kopia", "loaded_count", loadCount) + } } // Can't use the maps package to extract the values because we need to convert @@ -460,6 +466,8 @@ func (w Wrapper) ProduceRestoreCollections( res = append(res, c) } + logger.Ctx(ctx).Infow("done loading items from kopia", "loaded_count", loadCount) + return res, el.Failure() }