Skip to content
Snippets Groups Projects
Commit 7aea9babac5d authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

debugrevlog: display total stored information

This is an interesting statistis, so let's display it.
parent 511106bcb16c
No related branches found
No related tags found
3 merge requests!485branching: merge default into stable,!322changelog-v2: add a configuration to disable rank computation,!320debug-revlog: show total stored size
......@@ -288,6 +288,8 @@
if not flags:
flags = [b'(none)']
### the total size of stored content if incompressed.
full_text_total_size = 0
### tracks merge vs single parent
nummerges = 0
......@@ -347,7 +349,9 @@
p1, p2 = r.parentrevs(rev)
delta = r.deltaparent(rev)
if format > 0:
addsize(r.rawsize(rev), datasize)
s = r.rawsize(rev)
full_text_total_size += s
addsize(s, datasize)
if p2 != nodemod.nullrev:
nummerges += 1
size = r.length(rev)
......@@ -536,6 +540,18 @@
ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize))
ui.write(b'\n')
b_total = b"%d" % full_text_total_size
p_total = []
while len(b_total) > 3:
p_total.append(b_total[-3:])
b_total = b_total[:-3]
p_total.append(b_total)
p_total.reverse()
b_total = b' '.join(p_total)
ui.write(b'\n')
ui.writenoi18n(b'total-stored-content: %s bytes\n' % b_total)
ui.write(b'\n')
fmt = dfmtstr(max(avgchainlen, maxchainlen, maxchainspan, compratio))
ui.writenoi18n(b'avg chain length : ' + fmt % avgchainlen)
ui.writenoi18n(b'max chain length : ' + fmt % maxchainlen)
......
......@@ -39,6 +39,9 @@
chunks size : 191
0x75 (u) : 191 (100.00%)
total-stored-content: 188 bytes
avg chain length : 0
max chain length : 0
max chain reach : 67
......@@ -74,6 +77,9 @@
empty : 0 ( 0.00%)
0x75 (u) : 88 (100.00%)
total-stored-content: 86 bytes
avg chain length : 0
max chain length : 0
max chain reach : 44
......@@ -107,6 +113,9 @@
chunks size : 3
0x75 (u) : 3 (100.00%)
total-stored-content: 2 bytes
avg chain length : 0
max chain length : 0
max chain reach : 3
......
......@@ -126,6 +126,9 @@
chunks size : 58616973
0x28 : 58616973 (100.00%)
total-stored-content: 1 732 705 361 bytes
avg chain length : 9
max chain length : 15
max chain reach : 27366701
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment