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