From 1d3b4fbeec576db819b78227befc943fa6f2c6f1 Mon Sep 17 00:00:00 2001 From: Jason Chang Date: Tue, 20 Jun 2023 16:55:27 -0700 Subject: [PATCH] sync: Track new/existing project count New vs existing project may be a useful measure for analyzing sync performance. Bug: b/287105597 Change-Id: Ibea3e90c9fe3d16fd8b863bcae22b21963a6771a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/377574 Tested-by: Jason Chang Reviewed-by: Joanna Wang --- subcmds/sync.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subcmds/sync.py b/subcmds/sync.py index 224d9885..a2cc1f89 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -1676,6 +1676,13 @@ later is required to fix a server side protocol bug. err_update_projects = False err_update_linkfiles = False + # Log the repo projects by existing and new. + existing = [x for x in all_projects if x.Exists] + mp.config.SetString("repo.existingprojectcount", str(len(existing))) + mp.config.SetString( + "repo.newprojectcount", str(len(all_projects) - len(existing)) + ) + self._fetch_times = _FetchTimes(manifest) if not opt.local_only: with multiprocessing.Manager() as manager: