]> arthur.barton.de Git - bup.git/commitdiff
Report paths/s in index progress information.
authorRob Browning <rlb@defaultvalue.org>
Sat, 15 Feb 2014 02:52:30 +0000 (20:52 -0600)
committerRob Browning <rlb@defaultvalue.org>
Thu, 20 Mar 2014 22:22:20 +0000 (17:22 -0500)
Tested-by: Alexander Barton <alex@barton.de>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
cmd/index-cmd.py

index 59ec113517b10078a753226210aacc16e0b0deee..92a279176096ff9b828637e59fae60c434029298 100755 (executable)
@@ -80,6 +80,7 @@ def update_index(top, excluded_paths, exclude_rxs):
 
     total = 0
     bup_dir = os.path.abspath(git.repo())
+    index_start = time.time()
     for (path,pst) in drecurse.recursive_dirlist([top], xdev=opt.xdev,
                                                  bup_dir=bup_dir,
                                                  excluded_paths=excluded_paths,
@@ -87,9 +88,11 @@ def update_index(top, excluded_paths, exclude_rxs):
         if opt.verbose>=2 or (opt.verbose==1 and stat.S_ISDIR(pst.st_mode)):
             sys.stdout.write('%s\n' % path)
             sys.stdout.flush()
-            qprogress('Indexing: %d\r' % total)
+            paths_per_sec = total / (time.time() - index_start)
+            qprogress('Indexing: %d (%d paths/s)\r' % (total, paths_per_sec))
         elif not (total % 128):
-            qprogress('Indexing: %d\r' % total)
+            paths_per_sec = total / (time.time() - index_start)
+            qprogress('Indexing: %d (%d paths/s)\r' % (total, paths_per_sec))
         total += 1
         while rig.cur and rig.cur.name > path:  # deleted paths
             if rig.cur.exists():
@@ -146,8 +149,9 @@ def update_index(top, excluded_paths, exclude_rxs):
             if not stat.S_ISDIR(pst.st_mode) and pst.st_nlink > 1:
                 hlinks.add_path(path, pst.st_dev, pst.st_ino)
 
-    progress('Indexing: %d, done.\n' % total)
-    
+    paths_per_sec = total / (time.time() - index_start)
+    progress('Indexing: %d, done (%d paths/s).\n' % (total, paths_per_sec))
+
     hlinks.prepare_save()
 
     if ri.exists():