]> arthur.barton.de Git - bup.git/blobdiff - cmd/memtest-cmd.py
Makefile: fix test pattern to include t/test.sh
[bup.git] / cmd / memtest-cmd.py
index 4ed7c4742d4433d7631444239444624ebd1fea8a..0e3cf0c839d6a86402685a8589a0e5c6acf5b1b9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 import sys, re, struct, time, resource
-from bup import git, options, _helpers
+from bup import git, bloom, midx, options, _helpers
 from bup.helpers import *
 
 handle_ctrl_c()
@@ -78,7 +78,7 @@ git.check_repo_or_die()
 m = git.PackIdxList(git.repo('objects/pack'))
 
 report(-1)
-_helpers.random_partial_sha()
+_helpers.random_sha()
 report(0)
 
 if opt.existing:
@@ -94,7 +94,7 @@ for c in xrange(opt.cycles):
             bin = objit.next()
             assert(m.exists(bin))
         else:
-            bin = _helpers.random_partial_sha()
+            bin = _helpers.random_sha()
 
             # technically, a randomly generated object id might exist.
             # but the likelihood of that is the likelihood of finding
@@ -103,7 +103,16 @@ for c in xrange(opt.cycles):
             assert(not m.exists(bin))
     report((c+1)*opt.number)
 
-print ('%d objects searched in %d steps: avg %.3f steps/object' 
-       % (git._total_searches, git._total_steps,
-          git._total_steps*1.0/git._total_searches))
+if bloom._total_searches:
+    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))
+if midx._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))
+if git._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)