X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/819bfe459919769c9ddae14affeaa79596c640bb..cb8988eb4ab8147ef832c03bc01902ce3be4dcf5:/main.c diff --git a/main.c b/main.c index 629f6d20..12119799 100644 --- a/main.c +++ b/main.c @@ -274,9 +274,17 @@ static void output_summary(void) "sent %s bytes received %s bytes %s bytes/sec\n", human_num(total_written), human_num(total_read), human_dnum((total_written + total_read)/(0.5 + (endtime - starttime)), 2)); - rprintf(FINFO, "total size is %s speedup is %.2f%s\n", - human_num(stats.total_size), - (double)stats.total_size / (total_written+total_read), + rprintf(FINFO, "total size is %s speedup is ", + human_num(stats.total_size)); + /* With --dry-run or with --only-write-batch (unless we're a + * client receiver), the byte count doesn't include actual file + * data, so the speedup is meaningless and we don't print it. */ + if (write_batch < 0 ? (!am_server && !am_sender) : !dry_run) + rprintf(FINFO, "%.2f", + (double)stats.total_size / (total_written+total_read)); + else + rprintf(FINFO, "unknown"); + rprintf(FINFO, "%s\n", write_batch < 0 ? " (BATCH ONLY)" : dry_run ? " (DRY RUN)" : ""); }