mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-24 23:13:25 +00:00
remove csize from summarize return tuple
This commit is contained in:
parent
b726aa5665
commit
0211948cac
3 changed files with 4 additions and 4 deletions
|
@ -423,7 +423,7 @@ def __str__(self):
|
||||||
def stats(self):
|
def stats(self):
|
||||||
from .archive import Archive
|
from .archive import Archive
|
||||||
# XXX: this should really be moved down to `hashindex.pyx`
|
# XXX: this should really be moved down to `hashindex.pyx`
|
||||||
total_size, _, unique_size, _, total_unique_chunks, total_chunks = self.chunks.summarize()
|
total_size, unique_size, total_unique_chunks, total_chunks = self.chunks.summarize()
|
||||||
# the above values have the problem that they do not consider part files,
|
# the above values have the problem that they do not consider part files,
|
||||||
# thus the total_size might be too high (chunks referenced
|
# thus the total_size might be too high (chunks referenced
|
||||||
# by the part files AND by the complete file).
|
# by the part files AND by the complete file).
|
||||||
|
|
|
@ -358,7 +358,7 @@ cdef class ChunkIndex(IndexBase):
|
||||||
return iter
|
return iter
|
||||||
|
|
||||||
def summarize(self):
|
def summarize(self):
|
||||||
cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0
|
cdef uint64_t size = 0, unique_size = 0, chunks = 0, unique_chunks = 0
|
||||||
cdef uint32_t *values
|
cdef uint32_t *values
|
||||||
cdef uint32_t refcount
|
cdef uint32_t refcount
|
||||||
cdef unsigned char *key = NULL
|
cdef unsigned char *key = NULL
|
||||||
|
@ -375,7 +375,7 @@ cdef class ChunkIndex(IndexBase):
|
||||||
unique_size += _le32toh(values[1])
|
unique_size += _le32toh(values[1])
|
||||||
size += <uint64_t> _le32toh(values[1]) * _le32toh(values[0])
|
size += <uint64_t> _le32toh(values[1]) * _le32toh(values[0])
|
||||||
|
|
||||||
return size, csize, unique_size, unique_csize, unique_chunks, chunks
|
return size, unique_size, unique_chunks, chunks
|
||||||
|
|
||||||
def stats_against(self, ChunkIndex master_index):
|
def stats_against(self, ChunkIndex master_index):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -147,7 +147,7 @@ def test_chunkindex_summarize(self):
|
||||||
idx[H(2)] = 2, 2000, 200
|
idx[H(2)] = 2, 2000, 200
|
||||||
idx[H(3)] = 3, 3000, 300
|
idx[H(3)] = 3, 3000, 300
|
||||||
|
|
||||||
size, _, unique_size, _, unique_chunks, chunks = idx.summarize()
|
size, unique_size, unique_chunks, chunks = idx.summarize()
|
||||||
assert size == 1000 + 2 * 2000 + 3 * 3000
|
assert size == 1000 + 2 * 2000 + 3 * 3000
|
||||||
assert unique_size == 1000 + 2000 + 3000
|
assert unique_size == 1000 + 2000 + 3000
|
||||||
assert chunks == 1 + 2 + 3
|
assert chunks == 1 + 2 + 3
|
||||||
|
|
Loading…
Reference in a new issue