##// END OF EJS Templates
discovery: also audit the number of queries done...
marmoute -
r49881:f054a557 default
parent child Browse files
Show More
@@ -1221,6 +1221,7 b' def debugdiscovery(ui, repo, remoteurl=b'
1221 1221 # display discovery summary
1222 1222 fm.plain(b"elapsed time: %(elapsed)f seconds\n" % data)
1223 1223 fm.plain(b"round-trips: %(total-roundtrips)9d\n" % data)
1224 fm.plain(b"queries: %(total-queries)9d\n" % data)
1224 1225 fm.plain(b"heads summary:\n")
1225 1226 fm.plain(b" total common heads: %(nb-common-heads)9d\n" % data)
1226 1227 fm.plain(b" also local heads: %(nb-common-heads-local)9d\n" % data)
@@ -298,6 +298,9 b' def findcommonheads('
298 298
299 299 samplegrowth = float(ui.config(b'devel', b'discovery.grow-sample.rate'))
300 300
301 if audit is not None:
302 audit[b'total-queries'] = 0
303
301 304 start = util.timer()
302 305
303 306 roundtrips = 0
@@ -376,6 +379,8 b' def findcommonheads('
376 379 roundtrips += 1
377 380 with remote.commandexecutor() as e:
378 381 fheads = e.callcommand(b'heads', {})
382 if audit is not None:
383 audit[b'total-queries'] += len(sample)
379 384 fknown = e.callcommand(
380 385 b'known',
381 386 {
@@ -478,6 +483,8 b' def findcommonheads('
478 483 sample = list(sample)
479 484
480 485 with remote.commandexecutor() as e:
486 if audit is not None:
487 audit[b'total-queries'] += len(sample)
481 488 yesno = e.callcommand(
482 489 b'known',
483 490 {
@@ -39,6 +39,7 b' def findcommonincoming(repo, remote, hea'
39 39
40 40 if audit is not None:
41 41 audit[b'total-roundtrips'] = 1
42 audit[b'total-queries'] = 0
42 43
43 44 if repo.changelog.tip() == repo.nullid:
44 45 base.add(repo.nullid)
@@ -69,6 +70,8 b' def findcommonincoming(repo, remote, hea'
69 70 # head, root, first parent, second parent
70 71 # (a branch always has two parents (or none) by definition)
71 72 with remote.commandexecutor() as e:
73 if audit is not None:
74 audit[b'total-queries'] += len(unknown)
72 75 branches = e.callcommand(b'branches', {b'nodes': unknown}).result()
73 76
74 77 unknown = collections.deque(branches)
@@ -115,10 +118,13 b' def findcommonincoming(repo, remote, hea'
115 118 )
116 119 for p in pycompat.xrange(0, len(r), 10):
117 120 with remote.commandexecutor() as e:
121 subset = r[p : p + 10]
122 if audit is not None:
123 audit[b'total-queries'] += len(subset)
118 124 branches = e.callcommand(
119 125 b'branches',
120 126 {
121 b'nodes': r[p : p + 10],
127 b'nodes': subset,
122 128 },
123 129 ).result()
124 130
@@ -135,6 +141,8 b' def findcommonincoming(repo, remote, hea'
135 141 progress.increment()
136 142
137 143 with remote.commandexecutor() as e:
144 if audit is not None:
145 audit[b'total-queries'] += len(search)
138 146 between = e.callcommand(b'between', {b'pairs': search}).result()
139 147
140 148 for n, l in zip(search, between):
@@ -45,6 +45,7 b' Small superset:'
45 45 unpruned common: 01241442b3c2 66f7d451a68b b5714e113bc0
46 46 elapsed time: * seconds (glob)
47 47 round-trips: 2
48 queries: 6
48 49 heads summary:
49 50 total common heads: 2
50 51 also local heads: 2
@@ -77,6 +78,7 b' Small superset:'
77 78 all local changesets known remotely
78 79 elapsed time: * seconds (glob)
79 80 round-trips: 1
81 queries: 2
80 82 heads summary:
81 83 total common heads: 2
82 84 also local heads: 2
@@ -109,6 +111,7 b' Small superset:'
109 111 all local changesets known remotely
110 112 elapsed time: * seconds (glob)
111 113 round-trips: 1
114 queries: 1
112 115 heads summary:
113 116 total common heads: 1
114 117 also local heads: 1
@@ -140,6 +143,7 b' Small superset:'
140 143 unpruned common: 01241442b3c2 b5714e113bc0
141 144 elapsed time: * seconds (glob)
142 145 round-trips: 1
146 queries: 0
143 147 heads summary:
144 148 total common heads: 2
145 149 also local heads: 1
@@ -172,6 +176,7 b' Small superset:'
172 176 all remote heads known locally
173 177 elapsed time: * seconds (glob)
174 178 round-trips: 1
179 queries: 3
175 180 heads summary:
176 181 total common heads: 2
177 182 also local heads: 1
@@ -204,6 +209,7 b' Small superset:'
204 209 all remote heads known locally
205 210 elapsed time: * seconds (glob)
206 211 round-trips: 1
212 queries: 1
207 213 heads summary:
208 214 total common heads: 2
209 215 also local heads: 1
@@ -242,6 +248,7 b' Many new:'
242 248 unpruned common: bebd167eb94d
243 249 elapsed time: * seconds (glob)
244 250 round-trips: 2
251 queries: 3
245 252 heads summary:
246 253 total common heads: 1
247 254 also local heads: 1
@@ -277,6 +284,7 b' Many new:'
277 284 2 total queries in *.????s (glob)
278 285 elapsed time: * seconds (glob)
279 286 round-trips: 2
287 queries: 31
280 288 heads summary:
281 289 total common heads: 1
282 290 also local heads: 1
@@ -312,6 +320,7 b' Many new:'
312 320 2 total queries in *.????s (glob)
313 321 elapsed time: * seconds (glob)
314 322 round-trips: 2
323 queries: 32
315 324 heads summary:
316 325 total common heads: 1
317 326 also local heads: 0
@@ -343,6 +352,7 b' Many new:'
343 352 unpruned common: 66f7d451a68b bebd167eb94d
344 353 elapsed time: * seconds (glob)
345 354 round-trips: 4
355 queries: 5
346 356 heads summary:
347 357 total common heads: 1
348 358 also local heads: 0
@@ -378,6 +388,7 b' Many new:'
378 388 2 total queries in *.????s (glob)
379 389 elapsed time: * seconds (glob)
380 390 round-trips: 2
391 queries: 3
381 392 heads summary:
382 393 total common heads: 1
383 394 also local heads: 0
@@ -413,6 +424,7 b' Many new:'
413 424 2 total queries in *.????s (glob)
414 425 elapsed time: * seconds (glob)
415 426 round-trips: 2
427 queries: 3
416 428 heads summary:
417 429 total common heads: 1
418 430 also local heads: 0
@@ -450,6 +462,7 b' Both sides many new with stub:'
450 462 unpruned common: 2dc09a01254d
451 463 elapsed time: * seconds (glob)
452 464 round-trips: 4
465 queries: 5
453 466 heads summary:
454 467 total common heads: 1
455 468 also local heads: 1
@@ -485,6 +498,7 b' Both sides many new with stub:'
485 498 2 total queries in *.????s (glob)
486 499 elapsed time: * seconds (glob)
487 500 round-trips: 2
501 queries: 31
488 502 heads summary:
489 503 total common heads: 1
490 504 also local heads: 1
@@ -520,6 +534,7 b' Both sides many new with stub:'
520 534 2 total queries in *.????s (glob)
521 535 elapsed time: * seconds (glob)
522 536 round-trips: 2
537 queries: 32
523 538 heads summary:
524 539 total common heads: 1
525 540 also local heads: 0
@@ -551,6 +566,7 b' Both sides many new with stub:'
551 566 unpruned common: 2dc09a01254d 66f7d451a68b
552 567 elapsed time: * seconds (glob)
553 568 round-trips: 4
569 queries: 5
554 570 heads summary:
555 571 total common heads: 1
556 572 also local heads: 0
@@ -586,6 +602,7 b' Both sides many new with stub:'
586 602 2 total queries in *.????s (glob)
587 603 elapsed time: * seconds (glob)
588 604 round-trips: 2
605 queries: 30
589 606 heads summary:
590 607 total common heads: 1
591 608 also local heads: 0
@@ -621,6 +638,7 b' Both sides many new with stub:'
621 638 2 total queries in *.????s (glob)
622 639 elapsed time: * seconds (glob)
623 640 round-trips: 2
641 queries: 30
624 642 heads summary:
625 643 total common heads: 1
626 644 also local heads: 0
@@ -659,6 +677,7 b' Both many new:'
659 677 unpruned common: 66f7d451a68b
660 678 elapsed time: * seconds (glob)
661 679 round-trips: 4
680 queries: 5
662 681 heads summary:
663 682 total common heads: 1
664 683 also local heads: 0
@@ -694,6 +713,7 b' Both many new:'
694 713 2 total queries in *.????s (glob)
695 714 elapsed time: * seconds (glob)
696 715 round-trips: 2
716 queries: 32
697 717 heads summary:
698 718 total common heads: 1
699 719 also local heads: 0
@@ -729,6 +749,7 b' Both many new:'
729 749 2 total queries in *.????s (glob)
730 750 elapsed time: * seconds (glob)
731 751 round-trips: 2
752 queries: 32
732 753 heads summary:
733 754 total common heads: 1
734 755 also local heads: 0
@@ -760,6 +781,7 b' Both many new:'
760 781 unpruned common: 66f7d451a68b
761 782 elapsed time: * seconds (glob)
762 783 round-trips: 4
784 queries: 5
763 785 heads summary:
764 786 total common heads: 1
765 787 also local heads: 0
@@ -795,6 +817,7 b' Both many new:'
795 817 2 total queries in *.????s (glob)
796 818 elapsed time: * seconds (glob)
797 819 round-trips: 2
820 queries: 32
798 821 heads summary:
799 822 total common heads: 1
800 823 also local heads: 0
@@ -830,6 +853,7 b' Both many new:'
830 853 2 total queries in *.????s (glob)
831 854 elapsed time: * seconds (glob)
832 855 round-trips: 2
856 queries: 32
833 857 heads summary:
834 858 total common heads: 1
835 859 also local heads: 0
@@ -868,6 +892,7 b' Both many new skewed:'
868 892 unpruned common: 66f7d451a68b
869 893 elapsed time: * seconds (glob)
870 894 round-trips: 4
895 queries: 5
871 896 heads summary:
872 897 total common heads: 1
873 898 also local heads: 0
@@ -903,6 +928,7 b' Both many new skewed:'
903 928 2 total queries in *.????s (glob)
904 929 elapsed time: * seconds (glob)
905 930 round-trips: 2
931 queries: 52
906 932 heads summary:
907 933 total common heads: 1
908 934 also local heads: 0
@@ -938,6 +964,7 b' Both many new skewed:'
938 964 2 total queries in *.????s (glob)
939 965 elapsed time: * seconds (glob)
940 966 round-trips: 2
967 queries: 52
941 968 heads summary:
942 969 total common heads: 1
943 970 also local heads: 0
@@ -969,6 +996,7 b' Both many new skewed:'
969 996 unpruned common: 66f7d451a68b
970 997 elapsed time: * seconds (glob)
971 998 round-trips: 3
999 queries: 4
972 1000 heads summary:
973 1001 total common heads: 1
974 1002 also local heads: 0
@@ -1004,6 +1032,7 b' Both many new skewed:'
1004 1032 2 total queries in *.????s (glob)
1005 1033 elapsed time: * seconds (glob)
1006 1034 round-trips: 2
1035 queries: 32
1007 1036 heads summary:
1008 1037 total common heads: 1
1009 1038 also local heads: 0
@@ -1039,6 +1068,7 b' Both many new skewed:'
1039 1068 2 total queries in *.????s (glob)
1040 1069 elapsed time: * seconds (glob)
1041 1070 round-trips: 2
1071 queries: 32
1042 1072 heads summary:
1043 1073 total common heads: 1
1044 1074 also local heads: 0
@@ -1077,6 +1107,7 b' Both many new on top of long history:'
1077 1107 unpruned common: 7ead0cba2838
1078 1108 elapsed time: * seconds (glob)
1079 1109 round-trips: 4
1110 queries: 5
1080 1111 heads summary:
1081 1112 total common heads: 1
1082 1113 also local heads: 0
@@ -1115,6 +1146,7 b' Both many new on top of long history:'
1115 1146 3 total queries in *.????s (glob)
1116 1147 elapsed time: * seconds (glob)
1117 1148 round-trips: 3
1149 queries: 43
1118 1150 heads summary:
1119 1151 total common heads: 1
1120 1152 also local heads: 0
@@ -1153,6 +1185,7 b' Both many new on top of long history:'
1153 1185 3 total queries in *.????s (glob)
1154 1186 elapsed time: * seconds (glob)
1155 1187 round-trips: 3
1188 queries: 43
1156 1189 heads summary:
1157 1190 total common heads: 1
1158 1191 also local heads: 0
@@ -1184,6 +1217,7 b' Both many new on top of long history:'
1184 1217 unpruned common: 7ead0cba2838
1185 1218 elapsed time: * seconds (glob)
1186 1219 round-trips: 3
1220 queries: 4
1187 1221 heads summary:
1188 1222 total common heads: 1
1189 1223 also local heads: 0
@@ -1222,6 +1256,7 b' Both many new on top of long history:'
1222 1256 3 total queries in *.????s (glob)
1223 1257 elapsed time: * seconds (glob)
1224 1258 round-trips: 3
1259 queries: 27
1225 1260 heads summary:
1226 1261 total common heads: 1
1227 1262 also local heads: 0
@@ -1260,6 +1295,7 b' Both many new on top of long history:'
1260 1295 3 total queries in *.????s (glob)
1261 1296 elapsed time: * seconds (glob)
1262 1297 round-trips: 3
1298 queries: 27
1263 1299 heads summary:
1264 1300 total common heads: 1
1265 1301 also local heads: 0
@@ -1350,6 +1386,7 b' One with >200 heads. We now switch to se'
1350 1386 6 total queries in *.????s (glob)
1351 1387 elapsed time: * seconds (glob)
1352 1388 round-trips: 6
1389 queries: 1054
1353 1390 heads summary:
1354 1391 total common heads: 1
1355 1392 also local heads: 0
@@ -1387,6 +1424,7 b' One with >200 heads. We now switch to se'
1387 1424 3 total queries in *.????s (glob)
1388 1425 elapsed time: * seconds (glob)
1389 1426 round-trips: 3
1427 queries: 13
1390 1428 heads summary:
1391 1429 total common heads: 1
1392 1430 also local heads: 0
@@ -1436,6 +1474,7 b' One with >200 heads. We now switch to se'
1436 1474 9 total queries in *s (glob)
1437 1475 elapsed time: * seconds (glob)
1438 1476 round-trips: 9
1477 queries: 993
1439 1478 heads summary:
1440 1479 total common heads: 1
1441 1480 also local heads: 0
@@ -1564,6 +1603,7 b' returned as common heads.'
1564 1603 searching for changes
1565 1604 elapsed time: * seconds (glob)
1566 1605 round-trips: 1
1606 queries: 1
1567 1607 heads summary:
1568 1608 total common heads: 1
1569 1609 also local heads: 1
@@ -1610,6 +1650,7 b' remote will be last 25 heads of the loca'
1610 1650 all remote heads known locally
1611 1651 elapsed time: * seconds (glob)
1612 1652 round-trips: 1
1653 queries: 260
1613 1654 heads summary:
1614 1655 total common heads: 25
1615 1656 also local heads: 25
@@ -1655,6 +1696,7 b' remote will be last 25 heads of the loca'
1655 1696 3 total queries *s (glob)
1656 1697 elapsed time: * seconds (glob)
1657 1698 round-trips: 3
1699 queries: 109
1658 1700 heads summary:
1659 1701 total common heads: 1
1660 1702 also local heads: 0
@@ -1700,6 +1742,7 b' remote will be last 25 heads of the loca'
1700 1742 3 total queries in *s (glob)
1701 1743 elapsed time: * seconds (glob)
1702 1744 round-trips: 3
1745 queries: 109
1703 1746 heads summary:
1704 1747 total common heads: 1
1705 1748 also local heads: 0
@@ -1757,6 +1800,7 b' Test -T json output'
1757 1800 "nb-revs-common": 300,
1758 1801 "nb-revs-missing": 100,
1759 1802 "output": "query 1; heads\nsearching for changes\ntaking quick initial sample\nquery 2; still undecided: 375, sample size is: 81\nsampling from both directions\nquery 3; still undecided: 3, sample size is: 3\n3 total queries in *s\n", (glob)
1803 "total-queries": 109,
1760 1804 "total-roundtrips": 3
1761 1805 }
1762 1806 ]
General Comments 0
You need to be logged in to leave comments. Login now