compare-disco: display a header by default
authorPierre-Yves DAVID <pierre-yves.david@octobus.net>
Sat, 04 Jun 2022 18:58:07 +0200
changeset 49483 3c026138f234
parent 49482 df1d4e442c08
child 49484 ebbaf6a77807
compare-disco: display a header by default This help us to understand the output. (the code is hacky, but this is a quicky and dirty debug script)
contrib/perf-utils/compare-discovery-case
--- a/contrib/perf-utils/compare-discovery-case	Sat Jun 04 18:57:19 2022 +0200
+++ b/contrib/perf-utils/compare-discovery-case	Sat Jun 04 18:58:07 2022 +0200
@@ -113,8 +113,29 @@
         assert False
 
 
-def compare(repo, local_case, remote_case):
+def compare(
+    repo,
+    local_case,
+    remote_case,
+    display_header=True,
+):
     case = (repo, local_case, remote_case)
+    if display_header:
+        print(
+            "#",
+            "repo",
+            "local-subset",
+            "remote-subset",
+            "discovery-variant",
+            "roundtrips",
+            "queries",
+            "revs",
+            "local-heads",
+            "common-heads",
+            "undecided-initial",
+            "undecided-common",
+            "undecided-missing",
+        )
     for variant in VARIANTS_KEYS:
         res = process(case, VARIANTS[variant])
         revs = res["nb-revs"]
@@ -175,6 +196,10 @@
     argv = sys.argv[:]
 
     kwargs = {}
+    # primitive arg parsing
+    if '--no-header' in argv:
+        kwargs['display_header'] = False
+        argv = [a for a in argv if a != '--no-header']
 
     if len(argv) != 4:
         usage = f'USAGE: {script_name} REPO LOCAL_CASE REMOTE_CASE'