Mercurial > evolve
comparison hgext/evolve.py @ 1128:aabb145058d7
debugobsstorestats: drop the average meta length
Does not have much sense with the existence of multiple format with different
meta storage. We drop it for now and will introduce and average markers length
later.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 16 Oct 2014 11:54:44 -0700 |
parents | c8750f4388c8 |
children | da565c825429 |
comparison
equal
deleted
inserted
replaced
1127:87625964c333 | 1128:aabb145058d7 |
---|---|
980 nm = unfi.changelog.nodemap | 980 nm = unfi.changelog.nodemap |
981 ui.write('markers total: %9i\n' % len(store._all)) | 981 ui.write('markers total: %9i\n' % len(store._all)) |
982 sucscount = [0, 0 , 0, 0] | 982 sucscount = [0, 0 , 0, 0] |
983 known = 0 | 983 known = 0 |
984 parentsdata = 0 | 984 parentsdata = 0 |
985 metatotallenght = 0 | |
986 metakeys = {} | 985 metakeys = {} |
987 # node -> cluster mapping | 986 # node -> cluster mapping |
988 # a cluster is a (set(nodes), set(markers)) tuple | 987 # a cluster is a (set(nodes), set(markers)) tuple |
989 clustersmap = {} | 988 clustersmap = {} |
990 # same data using parent information | 989 # same data using parent information |
992 for mark in store: | 991 for mark in store: |
993 if mark[0] in nm: | 992 if mark[0] in nm: |
994 known += 1 | 993 known += 1 |
995 nbsucs = len(mark[1]) | 994 nbsucs = len(mark[1]) |
996 sucscount[min(nbsucs, 3)] += 1 | 995 sucscount[min(nbsucs, 3)] += 1 |
997 metatotallenght += len(mark[3]) | |
998 meta = obsolete.decodemeta(mark[3]) | 996 meta = obsolete.decodemeta(mark[3]) |
999 for key in meta: | 997 for key in meta: |
1000 metakeys.setdefault(key, 0) | 998 metakeys.setdefault(key, 0) |
1001 metakeys[key] += 1 | 999 metakeys[key] += 1 |
1002 parents = [meta.get('p1'), meta.get('p2')] | 1000 parents = [meta.get('p1'), meta.get('p2')] |
1057 ui.write('markers with no successors: %9i\n' % sucscount[0]) | 1055 ui.write('markers with no successors: %9i\n' % sucscount[0]) |
1058 ui.write(' 1 successors: %9i\n' % sucscount[1]) | 1056 ui.write(' 1 successors: %9i\n' % sucscount[1]) |
1059 ui.write(' 2 successors: %9i\n' % sucscount[2]) | 1057 ui.write(' 2 successors: %9i\n' % sucscount[2]) |
1060 ui.write(' more than 2 successors: %9i\n' % sucscount[3]) | 1058 ui.write(' more than 2 successors: %9i\n' % sucscount[3]) |
1061 # meta data info | 1059 # meta data info |
1062 ui.write('average meta length: %9i\n' | |
1063 % (metatotallenght/len(store._all))) | |
1064 ui.write(' available keys:\n') | 1060 ui.write(' available keys:\n') |
1065 for key in sorted(metakeys): | 1061 for key in sorted(metakeys): |
1066 ui.write(' %15s: %9i\n' % (key, metakeys[key])) | 1062 ui.write(' %15s: %9i\n' % (key, metakeys[key])) |
1067 | 1063 |
1068 allclusters = list(set(clustersmap.values())) | 1064 allclusters = list(set(clustersmap.values())) |