I've been looking at the --progress reporting, which is somewhat improved these days. But look at this output of this evening rawhide mirror update: [...] perl-DB_File-1.75-27.i386.rpm 73430 100% 519.63kB/s 0:00:00 perl-DB_File-1.75-28.99.3.i386.rpm 61783 100% 533.94kB/s 0:00:00 [...] Now, while it's good to have the ETA ticking down as something is fetched, it's irritating to have this history there on the screen afterwards with those unhelpful zeroes. Thus the appended patch to util.c in the current CVS head, which for the final progress report, puts to elapsed time for that file in the report instead of the time remaining. Applied (clean) to 2.5.4, it says this: ++ /home/cameron/tmp/rsy/rsync-2.5.4/rsync -rlHt -z -v -P --delete --include-from=.mirror-rsync '--exclude=xemacs*' '--exclude=kernel-source*' '--exclude=postgresql*' mirror.aarnet.edu.au::redhat/rawhide/i386/RedHat/RPMS/. ./redhat/rawhide/i386/RedHat/RPMS/. receiving file list ... 2429 files to consider 2305 files to consider ./ timeconfig-3.2.5-1.i386.rpm 158253 100% 160.48kB/s 0:00:00 timidity++-2.10.4-2.i386.rpm 9309389 100% 397.71kB/s 0:00:22 tix-8.2.0b1-67.i386.rpm 456809 100% 437.78kB/s 0:00:01 tk-8.3.3-67.i386.rpm 1371196 100% 433.77kB/s 0:00:03 Martin, can this go in for 2.5.5 please? Any nay sayers? Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/ Index: util.c ==================================================================RCS file: /cvsroot/rsync/util.c,v retrieving revision 1.107 diff -u -w -r1.107 util.c --- util.c 23 Feb 2002 00:05:06 -0000 1.107 +++ util.c 14 Mar 2002 09:27:16 -0000 @@ -866,7 +866,9 @@ unsigned long diff = msdiff(&start_time, now); double rate = diff ? (double) (ofs-start_ofs) * 1000.0 / diff / 1024.0 : 0; const char *units; - double remain = rate ? (double) (size-ofs) / rate / 1000.0: 0.0; + double remain = is_last + ? (double) diff / 1000.0 + : rate ? (double) (size-ofs) / rate / 1000.0 : 0.0; int remain_h, remain_m, remain_s; if (rate > 1024*1024) {
On 14 Mar 2002, Cameron Simpson <cs@zip.com.au> wrote:> timeconfig-3.2.5-1.i386.rpm > 158253 100% 160.48kB/s 0:00:00 > timidity++-2.10.4-2.i386.rpm > 9309389 100% 397.71kB/s 0:00:22 > tix-8.2.0b1-67.i386.rpm > 456809 100% 437.78kB/s 0:00:01 > tk-8.3.3-67.i386.rpm > 1371196 100% 433.77kB/s 0:00:03Good in concept. The current output does look a bit dumb. I'd like to take a broader look at our progress reporting. Since we have the whole file list, in theory we know not only about progress through the current file, but also progress in the overall tree. Perhaps something like the output from Debian's apt, if you know that. I'm wondering about a --machine-readable option that produces status output in a way that can be easily parsed by scripts or GUIs and that allows room for extension without breaking existing scripts. At the moment I'm leaning toward an rfc822-like plain text format with tags at the start of each line, and encouragement to parsers to ignore lines they do not understand. File-Begin: timeconfig-3.2.5-1.i386.rpm File-Size: 158253 Progress: 4000 Progress: 8000 ... File-Complete: timeconfig-3.2.5-1.i386.rpm etcetera I guess somebody is going to say "XML" at this point, but it does seem more complex. -- Martin
On 11:35 15 Mar 2002, Martin Pool <mbp@samba.org> wrote: | On 14 Mar 2002, Cameron Simpson <cs@zip.com.au> wrote: | | > timeconfig-3.2.5-1.i386.rpm | > 158253 100% 160.48kB/s 0:00:00 | > timidity++-2.10.4-2.i386.rpm | > 9309389 100% 397.71kB/s 0:00:22 | > tix-8.2.0b1-67.i386.rpm | > 456809 100% 437.78kB/s 0:00:01 | > tk-8.3.3-67.i386.rpm | > 1371196 100% 433.77kB/s 0:00:03 | | Good in concept. The current output does look a bit dumb. | | I'd like to take a broader look at our progress reporting. Cool. But perhaps put this in anyway until you've done something more thorough? I don't really want to keep personal patches floating around for trivia. | Since we | have the whole file list, in theory we know not only about progress | through the current file, but also progress in the overall tree. | Perhaps something like the output from Debian's apt, if you know that. | | I'm wondering about a --machine-readable option that produces status | output in a way that can be easily parsed by scripts or GUIs and that | allows room for extension without breaking existing scripts. At the | moment I'm leaning toward an rfc822-like plain text format with tags | at the start of each line, and encouragement to parsers to ignore | lines they do not understand. Sounds nice. I'd like to see all the -v stuff go there too. Coarse examples of -v tracing: LOCALSTAT pathname results REMOTESTAT pathname results # well, this would mean "the far end just sent us stat info" DECIDE what will happen to pathname DELETE pathname CREATE pathname stat-info? REPLACE pathname (old vs new?) PROGRESS pathname progress-info... [Reads a few lines down.] Or of course "Localstat:" ... | File-Begin: timeconfig-3.2.5-1.i386.rpm | File-Size: 158253 | Progress: 4000 | Progress: 8000 | ... | File-Complete: timeconfig-3.2.5-1.i386.rpm This kind of presumes that thens a start-end sequence with no interleaving. How about rfc822-like multilines: File-Begin: timeconfig-3.2.5-1.i386.rpm Size: 158253 ... i.e. an indented line continues the previous. That gets us records, which more sanely supports interleaved activity. The obvious downside that you can detect end of record without seeing the beginning of the next record, which sucks for progress reporting. This applies to your proposal too. I guess this would push me back you my first syntax above, with long lines for lots of info if needed. | I guess somebody is going to say "XML" at this point, but it does seem | more complex. And very shell hostile. XML is easily the wrong thing here unless we get into complex data structures. On the subject of shell hostility, rfc822 is a bit shell hostile. This is why my first instinct is to go for the plainer keyword syntax I offered above: ACTION info... Cheers, -- Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/ ...don't permit your spirit to be dampened by pinheaded bottom liners who feel the proper work environment is one that resembles a benign prison camp. - a Good Times horoscope