RHash icon indicating copy to clipboard operation
RHash copied to clipboard

Show overall progress when checking

Open Sarke opened this issue 4 years ago • 4 comments

I see there are flags to show the speed and progress per file, but what about overall progress?

It would involve counting the lines in the checksum file and then showing a progress bar or percentage when checking.

Sarke avatar Nov 02 '21 09:11 Sarke

The files listed in a hash file can vary greatly in size. So the speed calculated by the count of lines will be essentially nonuniform. This can be mitigated if such overall progress is printed in the form [ CURRENT_LINE / TOTAL_LINES ]. This form of total progress is already used by some Linux utilities, like apt.

Some notes:

  • Such feature will not work for a hash file coming from the program standard input.
  • Reading a big hash file twice can be slow, especially from a slow network filesystem (this degradation can be just mentioned in the manpage).
  • It's not clear what should be shown, when many hash files are verified, Should RHash first read all of them to count the total number of lines?
  • What about other RHash program modes, i.e. creation of a hash file. Should RHash first calculate total amount of work, before doing it? This can significantly delay the start of file hashing, reducing the feature usefulness from the UX perspective.

rhash avatar Jun 19 '22 23:06 rhash

I've come full circle. I was looking for a tool to do this. I (re-)discovered rhash. Then I tried to search for a way for it to display overall progress...

Sarke avatar May 21 '23 23:05 Sarke

I think it would be best to just get the file size of each file in the hash list (which is fast, at least if you are not trying to verify a list with millions of small files on a HDD) and then display the overall progress based on bytes_hashed/bytes_overall. Best would be to also print some kind of ETA (based on the avg speed of the last minute), something like:

--( Verifying checksums.md5 ) ------------
fileA      3%      [Total 0.2%, ETA: 03h 42m 30s]

nioncode avatar Jan 12 '24 19:01 nioncode

Not all hash list are short. Not all filesystems are fast to return file size (even not all files specified on the command line have a file size).

Not for all users RHash (with the discussed feature) will instantly start calculating with percents. So there will be requests to print something while RHash is calculating sizes before the actual work. It's a neverending wheel of feature requests.

rhash avatar Jan 23 '24 09:01 rhash