##// END OF EJS Templates
debugdiscovery: display the number of roundtrip used...
marmoute -
r46726:d90f439f default
parent child Browse files
Show More
@@ -978,6 +978,7 b' def debugdiscovery(ui, repo, remoteurl=b'
978 978 # make sure tests are repeatable
979 979 random.seed(int(opts[b'seed']))
980 980
981 data = {}
981 982 if opts.get(b'old'):
982 983
983 984 def doit(pushedrevs, remoteheads, remote=remote):
@@ -985,7 +986,7 b' def debugdiscovery(ui, repo, remoteurl=b'
985 986 # enable in-client legacy support
986 987 remote = localrepo.locallegacypeer(remote.local())
987 988 common, _in, hds = treediscovery.findcommonincoming(
988 repo, remote, force=True
989 repo, remote, force=True, audit=data
989 990 )
990 991 common = set(common)
991 992 if not opts.get(b'nonheads'):
@@ -1007,7 +1008,7 b' def debugdiscovery(ui, repo, remoteurl=b'
1007 1008 revs = scmutil.revrange(repo, pushedrevs)
1008 1009 nodes = [repo[r].node() for r in revs]
1009 1010 common, any, hds = setdiscovery.findcommonheads(
1010 ui, repo, remote, ancestorsof=nodes
1011 ui, repo, remote, ancestorsof=nodes, audit=data
1011 1012 )
1012 1013 return common, hds
1013 1014
@@ -1042,7 +1043,6 b' def debugdiscovery(ui, repo, remoteurl=b'
1042 1043 common_initial_undecided = initial_undecided & common
1043 1044 missing_initial_undecided = initial_undecided & missing
1044 1045
1045 data = {}
1046 1046 data[b'elapsed'] = t.elapsed
1047 1047 data[b'nb-common-heads'] = len(heads_common)
1048 1048 data[b'nb-common-heads-local'] = len(heads_common_local)
@@ -1068,6 +1068,7 b' def debugdiscovery(ui, repo, remoteurl=b'
1068 1068
1069 1069 # display discovery summary
1070 1070 ui.writenoi18n(b"elapsed time: %(elapsed)f seconds\n" % data)
1071 ui.writenoi18n(b"round-trips: %(total-roundtrips)9d\n" % data)
1071 1072 ui.writenoi18n(b"heads summary:\n")
1072 1073 ui.writenoi18n(b" total common heads: %(nb-common-heads)9d\n" % data)
1073 1074 ui.writenoi18n(
@@ -291,9 +291,14 b' def findcommonheads('
291 291 abortwhenunrelated=True,
292 292 ancestorsof=None,
293 293 samplegrowth=1.05,
294 audit=None,
294 295 ):
295 296 """Return a tuple (common, anyincoming, remoteheads) used to identify
296 297 missing nodes from or in remote.
298
299 The audit argument is an optional dictionnary that a caller can pass. it
300 will be updated with extra data about the discovery, this is useful for
301 debug.
297 302 """
298 303 start = util.timer()
299 304
@@ -379,6 +384,9 b' def findcommonheads('
379 384
380 385 srvheadhashes, yesno = fheads.result(), fknown.result()
381 386
387 if audit is not None:
388 audit[b'total-roundtrips'] = 1
389
382 390 if cl.tip() == nullid:
383 391 if srvheadhashes != [nullid]:
384 392 return [nullid], True, srvheadhashes
@@ -473,6 +481,9 b' def findcommonheads('
473 481 missing = set(result) - set(knownsrvheads)
474 482 ui.log(b'discovery', msg, len(result), len(missing), roundtrips, elapsed)
475 483
484 if audit is not None:
485 audit[b'total-roundtrips'] = roundtrips
486
476 487 if not result and srvheadhashes != [nullid]:
477 488 if abortwhenunrelated:
478 489 raise error.Abort(_(b"repository is unrelated"))
@@ -20,7 +20,7 b' from . import ('
20 20 )
21 21
22 22
23 def findcommonincoming(repo, remote, heads=None, force=False):
23 def findcommonincoming(repo, remote, heads=None, force=False, audit=None):
24 24 """Return a tuple (common, fetch, heads) used to identify the common
25 25 subset of nodes between repo and remote.
26 26
@@ -41,6 +41,9 b' def findcommonincoming(repo, remote, hea'
41 41 with remote.commandexecutor() as e:
42 42 heads = e.callcommand(b'heads', {}).result()
43 43
44 if audit is not None:
45 audit[b'total-roundtrips'] = 1
46
44 47 if repo.changelog.tip() == nullid:
45 48 base.add(nullid)
46 49 if heads != [nullid]:
@@ -181,5 +184,7 b' def findcommonincoming(repo, remote, hea'
181 184
182 185 progress.complete()
183 186 repo.ui.debug(b"%d total queries\n" % reqcnt)
187 if audit is not None:
188 audit[b'total-roundtrips'] = reqcnt
184 189
185 190 return base, list(fetch), heads
@@ -44,6 +44,7 b' Small superset:'
44 44 searching for changes
45 45 unpruned common: 01241442b3c2 66f7d451a68b b5714e113bc0
46 46 elapsed time: * seconds (glob)
47 round-trips: 2
47 48 heads summary:
48 49 total common heads: 2
49 50 also local heads: 2
@@ -75,6 +76,7 b' Small superset:'
75 76 searching for changes
76 77 all local changesets known remotely
77 78 elapsed time: * seconds (glob)
79 round-trips: 1
78 80 heads summary:
79 81 total common heads: 2
80 82 also local heads: 2
@@ -106,6 +108,7 b' Small superset:'
106 108 searching for changes
107 109 all local changesets known remotely
108 110 elapsed time: * seconds (glob)
111 round-trips: 1
109 112 heads summary:
110 113 total common heads: 1
111 114 also local heads: 1
@@ -136,6 +139,7 b' Small superset:'
136 139 searching for changes
137 140 unpruned common: 01241442b3c2 b5714e113bc0
138 141 elapsed time: * seconds (glob)
142 round-trips: 1
139 143 heads summary:
140 144 total common heads: 2
141 145 also local heads: 1
@@ -167,6 +171,7 b' Small superset:'
167 171 searching for changes
168 172 all remote heads known locally
169 173 elapsed time: * seconds (glob)
174 round-trips: 1
170 175 heads summary:
171 176 total common heads: 2
172 177 also local heads: 1
@@ -198,6 +203,7 b' Small superset:'
198 203 searching for changes
199 204 all remote heads known locally
200 205 elapsed time: * seconds (glob)
206 round-trips: 1
201 207 heads summary:
202 208 total common heads: 2
203 209 also local heads: 1
@@ -235,6 +241,7 b' Many new:'
235 241 searching for changes
236 242 unpruned common: bebd167eb94d
237 243 elapsed time: * seconds (glob)
244 round-trips: 2
238 245 heads summary:
239 246 total common heads: 1
240 247 also local heads: 1
@@ -269,6 +276,7 b' Many new:'
269 276 query 2; still undecided: 29, sample size is: 29
270 277 2 total queries in *.????s (glob)
271 278 elapsed time: * seconds (glob)
279 round-trips: 2
272 280 heads summary:
273 281 total common heads: 1
274 282 also local heads: 1
@@ -303,6 +311,7 b' Many new:'
303 311 query 2; still undecided: 31, sample size is: 31
304 312 2 total queries in *.????s (glob)
305 313 elapsed time: * seconds (glob)
314 round-trips: 2
306 315 heads summary:
307 316 total common heads: 1
308 317 also local heads: 0
@@ -333,6 +342,7 b' Many new:'
333 342 searching for changes
334 343 unpruned common: 66f7d451a68b bebd167eb94d
335 344 elapsed time: * seconds (glob)
345 round-trips: 4
336 346 heads summary:
337 347 total common heads: 1
338 348 also local heads: 0
@@ -367,6 +377,7 b' Many new:'
367 377 query 2; still undecided: 2, sample size is: 2
368 378 2 total queries in *.????s (glob)
369 379 elapsed time: * seconds (glob)
380 round-trips: 2
370 381 heads summary:
371 382 total common heads: 1
372 383 also local heads: 0
@@ -401,6 +412,7 b' Many new:'
401 412 query 2; still undecided: 2, sample size is: 2
402 413 2 total queries in *.????s (glob)
403 414 elapsed time: * seconds (glob)
415 round-trips: 2
404 416 heads summary:
405 417 total common heads: 1
406 418 also local heads: 0
@@ -437,6 +449,7 b' Both sides many new with stub:'
437 449 searching for changes
438 450 unpruned common: 2dc09a01254d
439 451 elapsed time: * seconds (glob)
452 round-trips: 4
440 453 heads summary:
441 454 total common heads: 1
442 455 also local heads: 1
@@ -471,6 +484,7 b' Both sides many new with stub:'
471 484 query 2; still undecided: 29, sample size is: 29
472 485 2 total queries in *.????s (glob)
473 486 elapsed time: * seconds (glob)
487 round-trips: 2
474 488 heads summary:
475 489 total common heads: 1
476 490 also local heads: 1
@@ -505,6 +519,7 b' Both sides many new with stub:'
505 519 query 2; still undecided: 31, sample size is: 31
506 520 2 total queries in *.????s (glob)
507 521 elapsed time: * seconds (glob)
522 round-trips: 2
508 523 heads summary:
509 524 total common heads: 1
510 525 also local heads: 0
@@ -535,6 +550,7 b' Both sides many new with stub:'
535 550 searching for changes
536 551 unpruned common: 2dc09a01254d 66f7d451a68b
537 552 elapsed time: * seconds (glob)
553 round-trips: 4
538 554 heads summary:
539 555 total common heads: 1
540 556 also local heads: 0
@@ -569,6 +585,7 b' Both sides many new with stub:'
569 585 query 2; still undecided: 29, sample size is: 29
570 586 2 total queries in *.????s (glob)
571 587 elapsed time: * seconds (glob)
588 round-trips: 2
572 589 heads summary:
573 590 total common heads: 1
574 591 also local heads: 0
@@ -603,6 +620,7 b' Both sides many new with stub:'
603 620 query 2; still undecided: 29, sample size is: 29
604 621 2 total queries in *.????s (glob)
605 622 elapsed time: * seconds (glob)
623 round-trips: 2
606 624 heads summary:
607 625 total common heads: 1
608 626 also local heads: 0
@@ -640,6 +658,7 b' Both many new:'
640 658 searching for changes
641 659 unpruned common: 66f7d451a68b
642 660 elapsed time: * seconds (glob)
661 round-trips: 4
643 662 heads summary:
644 663 total common heads: 1
645 664 also local heads: 0
@@ -674,6 +693,7 b' Both many new:'
674 693 query 2; still undecided: 31, sample size is: 31
675 694 2 total queries in *.????s (glob)
676 695 elapsed time: * seconds (glob)
696 round-trips: 2
677 697 heads summary:
678 698 total common heads: 1
679 699 also local heads: 0
@@ -708,6 +728,7 b' Both many new:'
708 728 query 2; still undecided: 31, sample size is: 31
709 729 2 total queries in *.????s (glob)
710 730 elapsed time: * seconds (glob)
731 round-trips: 2
711 732 heads summary:
712 733 total common heads: 1
713 734 also local heads: 0
@@ -738,6 +759,7 b' Both many new:'
738 759 searching for changes
739 760 unpruned common: 66f7d451a68b
740 761 elapsed time: * seconds (glob)
762 round-trips: 4
741 763 heads summary:
742 764 total common heads: 1
743 765 also local heads: 0
@@ -772,6 +794,7 b' Both many new:'
772 794 query 2; still undecided: 31, sample size is: 31
773 795 2 total queries in *.????s (glob)
774 796 elapsed time: * seconds (glob)
797 round-trips: 2
775 798 heads summary:
776 799 total common heads: 1
777 800 also local heads: 0
@@ -806,6 +829,7 b' Both many new:'
806 829 query 2; still undecided: 31, sample size is: 31
807 830 2 total queries in *.????s (glob)
808 831 elapsed time: * seconds (glob)
832 round-trips: 2
809 833 heads summary:
810 834 total common heads: 1
811 835 also local heads: 0
@@ -843,6 +867,7 b' Both many new skewed:'
843 867 searching for changes
844 868 unpruned common: 66f7d451a68b
845 869 elapsed time: * seconds (glob)
870 round-trips: 4
846 871 heads summary:
847 872 total common heads: 1
848 873 also local heads: 0
@@ -877,6 +902,7 b' Both many new skewed:'
877 902 query 2; still undecided: 51, sample size is: 51
878 903 2 total queries in *.????s (glob)
879 904 elapsed time: * seconds (glob)
905 round-trips: 2
880 906 heads summary:
881 907 total common heads: 1
882 908 also local heads: 0
@@ -911,6 +937,7 b' Both many new skewed:'
911 937 query 2; still undecided: 51, sample size is: 51
912 938 2 total queries in *.????s (glob)
913 939 elapsed time: * seconds (glob)
940 round-trips: 2
914 941 heads summary:
915 942 total common heads: 1
916 943 also local heads: 0
@@ -941,6 +968,7 b' Both many new skewed:'
941 968 searching for changes
942 969 unpruned common: 66f7d451a68b
943 970 elapsed time: * seconds (glob)
971 round-trips: 3
944 972 heads summary:
945 973 total common heads: 1
946 974 also local heads: 0
@@ -975,6 +1003,7 b' Both many new skewed:'
975 1003 query 2; still undecided: 31, sample size is: 31
976 1004 2 total queries in *.????s (glob)
977 1005 elapsed time: * seconds (glob)
1006 round-trips: 2
978 1007 heads summary:
979 1008 total common heads: 1
980 1009 also local heads: 0
@@ -1009,6 +1038,7 b' Both many new skewed:'
1009 1038 query 2; still undecided: 31, sample size is: 31
1010 1039 2 total queries in *.????s (glob)
1011 1040 elapsed time: * seconds (glob)
1041 round-trips: 2
1012 1042 heads summary:
1013 1043 total common heads: 1
1014 1044 also local heads: 0
@@ -1046,6 +1076,7 b' Both many new on top of long history:'
1046 1076 searching for changes
1047 1077 unpruned common: 7ead0cba2838
1048 1078 elapsed time: * seconds (glob)
1079 round-trips: 4
1049 1080 heads summary:
1050 1081 total common heads: 1
1051 1082 also local heads: 0
@@ -1083,6 +1114,7 b' Both many new on top of long history:'
1083 1114 query 3; still undecided: 31, sample size is: 31
1084 1115 3 total queries in *.????s (glob)
1085 1116 elapsed time: * seconds (glob)
1117 round-trips: 3
1086 1118 heads summary:
1087 1119 total common heads: 1
1088 1120 also local heads: 0
@@ -1120,6 +1152,7 b' Both many new on top of long history:'
1120 1152 query 3; still undecided: 31, sample size is: 31
1121 1153 3 total queries in *.????s (glob)
1122 1154 elapsed time: * seconds (glob)
1155 round-trips: 3
1123 1156 heads summary:
1124 1157 total common heads: 1
1125 1158 also local heads: 0
@@ -1150,6 +1183,7 b' Both many new on top of long history:'
1150 1183 searching for changes
1151 1184 unpruned common: 7ead0cba2838
1152 1185 elapsed time: * seconds (glob)
1186 round-trips: 3
1153 1187 heads summary:
1154 1188 total common heads: 1
1155 1189 also local heads: 0
@@ -1187,6 +1221,7 b' Both many new on top of long history:'
1187 1221 query 3; still undecided: 15, sample size is: 15
1188 1222 3 total queries in *.????s (glob)
1189 1223 elapsed time: * seconds (glob)
1224 round-trips: 3
1190 1225 heads summary:
1191 1226 total common heads: 1
1192 1227 also local heads: 0
@@ -1224,6 +1259,7 b' Both many new on top of long history:'
1224 1259 query 3; still undecided: 15, sample size is: 15
1225 1260 3 total queries in *.????s (glob)
1226 1261 elapsed time: * seconds (glob)
1262 round-trips: 3
1227 1263 heads summary:
1228 1264 total common heads: 1
1229 1265 also local heads: 0
@@ -1313,6 +1349,7 b' One with >200 heads. We now switch to se'
1313 1349 query 6; still undecided: 63, sample size is: 63
1314 1350 6 total queries in *.????s (glob)
1315 1351 elapsed time: * seconds (glob)
1352 round-trips: 6
1316 1353 heads summary:
1317 1354 total common heads: 1
1318 1355 also local heads: 0
@@ -1349,6 +1386,7 b' One with >200 heads. We now switch to se'
1349 1386 query 3; still undecided: 3, sample size is: 3
1350 1387 3 total queries in *.????s (glob)
1351 1388 elapsed time: * seconds (glob)
1389 round-trips: 3
1352 1390 heads summary:
1353 1391 total common heads: 1
1354 1392 also local heads: 0
@@ -1476,6 +1514,7 b' returned as common heads.'
1476 1514 comparing with $TESTTMP/ancestorsof/a
1477 1515 searching for changes
1478 1516 elapsed time: * seconds (glob)
1517 round-trips: 1
1479 1518 heads summary:
1480 1519 total common heads: 1
1481 1520 also local heads: 1
General Comments 0
You need to be logged in to leave comments. Login now