diff options
author | Jason Chang <jasonnc@google.com> | 2023-06-20 16:55:27 -0700 |
---|---|---|
committer | Joanna Wang <jojwang@google.com> | 2023-06-23 20:08:58 +0000 |
commit | 1d3b4fbeec576db819b78227befc943fa6f2c6f1 (patch) | |
tree | cd3b1a59a50255fe9720fa7b585799c82a9c259d /subcmds/sync.py | |
parent | be71c2f80fa115e8256211fd0e3116d93cfae93e (diff) | |
download | git-repo-1d3b4fbeec576db819b78227befc943fa6f2c6f1.tar.gz |
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 <jasonnc@google.com>
Reviewed-by: Joanna Wang <jojwang@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 7 |
1 files changed, 7 insertions, 0 deletions
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. | |||
1676 | err_update_projects = False | 1676 | err_update_projects = False |
1677 | err_update_linkfiles = False | 1677 | err_update_linkfiles = False |
1678 | 1678 | ||
1679 | # Log the repo projects by existing and new. | ||
1680 | existing = [x for x in all_projects if x.Exists] | ||
1681 | mp.config.SetString("repo.existingprojectcount", str(len(existing))) | ||
1682 | mp.config.SetString( | ||
1683 | "repo.newprojectcount", str(len(all_projects) - len(existing)) | ||
1684 | ) | ||
1685 | |||
1679 | self._fetch_times = _FetchTimes(manifest) | 1686 | self._fetch_times = _FetchTimes(manifest) |
1680 | if not opt.local_only: | 1687 | if not opt.local_only: |
1681 | with multiprocessing.Manager() as manager: | 1688 | with multiprocessing.Manager() as manager: |