Thread (8 messages) flat view 8 messages, 2 authors, 2016-06-15

Re: long fsck time

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:52:22

2011/11/3 Jeff King [off-list ref]:
On Wed, Nov 02, 2011 at 07:10:26PM +0700, Nguyen Thai Ngoc Duy wrote:
quoted
On Wed, Nov 2, 2011 at 7:06 PM, Nguyen Thai Ngoc Duy [off-list ref] wrote:
quoted
On git.git

$ /usr/bin/time git fsck
333.25user 4.28system 5:37.59elapsed 99%CPU (0avgtext+0avgdata
420080maxresident)k
0inputs+0outputs (0major+726560minor)pagefaults 0swaps

That's really long time, perhaps we should print progress so users
know it's still running?
Ahh.. --verbose. Sorry for the noise. Still good to show the number of
checked objects though.
fsck --verbose is _really_ verbose. It could probably stand to have some
progress meters sprinkled throughout. The patch below produces this on
my git.git repo:

Yes, I wanted something like this.
 $ git fsck
 Checking object directories: 100% (256/256), done.
 Verifying packs: 100% (7/7), done.
 Checking objects (pack 1/7): 100% (241/241), done.
 Checking objects (pack 2/7): 100% (176/176), done.
 Checking objects (pack 3/7): 100% (312/312), done.
 Checking objects (pack 4/7): 100% (252/252), done.
 Checking objects (pack 5/7): 100% (353/353), done.
 Checking objects (pack 6/7): 100% (375/375), done.
 Checking objects (pack 7/7): 100% (171079/171079), done.
Would be better if we only output one "Checking objects" line.
which gives reasonably smooth progress. The longest hang is that
"Verifying pack" 7 is slow (I believe it's doing a sha1 over the whole
thing). If you really wanted to get fancy, you could probably do a
throughput meter as we sha1 the whole contents.
I'll give it a try.
Patch is below. It would need --{no-,}progress support on the command
line, and to check isatty(2) before it would be acceptable.
Agreed on isatty(), though I think this output should be default (with
maybe --quiet to silence it on tty). Other messages may be prepended
with severity to indicate they are not progress output.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help