from bup import git, bloom, midx, options, _helpers
from bup.compat import range
from bup.helpers import handle_ctrl_c
from bup import git, bloom, midx, options, _helpers
from bup.compat import range
from bup.helpers import handle_ctrl_c
#fields = ['VmSize', 'VmRSS', 'VmData', 'VmStk', 'ms']
d = {}
try:
#fields = ['VmSize', 'VmRSS', 'VmData', 'VmStk', 'ms']
d = {}
try:
# happens, this split() might not return two elements. We don't
# really need to care about the binary format since this output
# isn't used for much and report() can deal with missing entries.
# happens, this split() might not return two elements. We don't
# really need to care about the binary format since this output
# isn't used for much and report() can deal with missing entries.
global last, last_u, last_s, start
headers = ['RSS', 'MajFlt', 'user', 'sys', 'ms']
ru = resource.getrusage(resource.RUSAGE_SELF)
now = time.time()
global last, last_u, last_s, start
headers = ['RSS', 'MajFlt', 'user', 'sys', 'ms']
ru = resource.getrusage(resource.RUSAGE_SELF)
now = time.time()
# a collision in sha-1 by accident, which is so unlikely that
# we don't care.
assert(not m.exists(bin))
# a collision in sha-1 by accident, which is so unlikely that
# we don't care.
assert(not m.exists(bin))
- print('bloom: %d objects searched in %d steps: avg %.3f steps/object'
- % (bloom._total_searches, bloom._total_steps,
- bloom._total_steps*1.0/bloom._total_searches))
+ out.write(b'bloom: %d objects searched in %d steps: avg %.3f steps/object\n'
+ % (bloom._total_searches, bloom._total_steps,
+ bloom._total_steps*1.0/bloom._total_searches))
- print('midx: %d objects searched in %d steps: avg %.3f steps/object'
- % (midx._total_searches, midx._total_steps,
- midx._total_steps*1.0/midx._total_searches))
+ out.write(b'midx: %d objects searched in %d steps: avg %.3f steps/object\n'
+ % (midx._total_searches, midx._total_steps,
+ midx._total_steps*1.0/midx._total_searches))
- print('idx: %d objects searched in %d steps: avg %.3f steps/object'
- % (git._total_searches, git._total_steps,
- git._total_steps*1.0/git._total_searches))
-print('Total time: %.3fs' % (time.time() - start))
+ out.write(b'idx: %d objects searched in %d steps: avg %.3f steps/object\n'
+ % (git._total_searches, git._total_steps,
+ git._total_steps*1.0/git._total_searches))
+out.write(b'Total time: %.3fs\n' % (time.time() - start))