summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
53135fe)
the report happens after all --delete-after activity has ceased when
pulling, and (2) a batch-file created when pushing gets the stats
values written out prior to any end-of-run keep-alive packets.
extern int verbose;
extern int dry_run;
extern int list_only;
extern int verbose;
extern int dry_run;
extern int list_only;
int status;
} pid_stat_table[MAXCHILDPROCS];
int status;
} pid_stat_table[MAXCHILDPROCS];
+static time_t starttime, endtime;
+static int64 total_read, total_written;
+
static void show_malloc_stats(void);
/****************************************************************************
static void show_malloc_stats(void);
/****************************************************************************
* the report. All processes might also generate a set of debug stats, if
* the verbose level is high enough (this is the only thing that the
* generator process and the server receiver ever do here). */
* the report. All processes might also generate a set of debug stats, if
* the verbose level is high enough (this is the only thing that the
* generator process and the server receiver ever do here). */
-static void report(int f)
+static void handle_stats(int f)
+ endtime = time(NULL);
+
/* Cache two stats because the read/write code can change it. */
/* Cache two stats because the read/write code can change it. */
- int64 total_read = stats.total_read;
- int64 total_written = stats.total_written;
- time_t t = time(NULL);
+ total_read = stats.total_read;
+ total_written = stats.total_written;
if (do_stats && verbose > 1) {
/* These come out from every process */
if (do_stats && verbose > 1) {
/* These come out from every process */
+ fflush(stdout);
+ fflush(stderr);
+}
+
+static void output_summary(void)
+{
if (verbose || do_stats) {
rprintf(FINFO,
"\nsent %.0f bytes received %.0f bytes %.2f bytes/sec\n",
(double)total_written, (double)total_read,
if (verbose || do_stats) {
rprintf(FINFO,
"\nsent %.0f bytes received %.0f bytes %.2f bytes/sec\n",
(double)total_written, (double)total_read,
- (total_written + total_read)/(0.5 + (t - starttime)));
+ (total_written + total_read)/(0.5 + (endtime - starttime)));
rprintf(FINFO, "total size is %.0f speedup is %.2f\n",
(double)stats.total_size,
(double)stats.total_size / (total_written+total_read));
rprintf(FINFO, "total size is %.0f speedup is %.2f\n",
(double)stats.total_size,
(double)stats.total_size / (total_written+total_read));
send_files(flist,f_out,f_in);
io_flush(FULL_FLUSH);
send_files(flist,f_out,f_in);
io_flush(FULL_FLUSH);
if (protocol_version >= 24)
read_final_goodbye(f_in, f_out);
io_flush(FULL_FLUSH);
if (protocol_version >= 24)
read_final_goodbye(f_in, f_out);
io_flush(FULL_FLUSH);
recv_files(f_in, flist, local_name);
io_flush(FULL_FLUSH);
recv_files(f_in, flist, local_name);
io_flush(FULL_FLUSH);
send_msg(MSG_DONE, "", 0);
io_flush(FULL_FLUSH);
send_msg(MSG_DONE, "", 0);
io_flush(FULL_FLUSH);
generate_files(f_out, flist, local_name);
generate_files(f_out, flist, local_name);
io_flush(FULL_FLUSH);
if (protocol_version >= 24) {
/* send a final goodbye message */
io_flush(FULL_FLUSH);
if (protocol_version >= 24) {
/* send a final goodbye message */
io_flush(NORMAL_FLUSH);
send_files(flist,f_out,f_in);
io_flush(FULL_FLUSH);
io_flush(NORMAL_FLUSH);
send_files(flist,f_out,f_in);
io_flush(FULL_FLUSH);
if (protocol_version >= 24)
read_final_goodbye(f_in, f_out);
if (pid != -1) {
if (protocol_version >= 24)
read_final_goodbye(f_in, f_out);
if (pid != -1) {
io_flush(FULL_FLUSH);
wait_process(pid, &status);
}
io_flush(FULL_FLUSH);
wait_process(pid, &status);
}
static RETSIGTYPE sigusr2_handler(UNUSED(int val))
{
static RETSIGTYPE sigusr2_handler(UNUSED(int val))
{
+ if (!am_server)
+ output_summary();
- if (log_got_error) _exit(RERR_PARTIAL);
+ if (log_got_error)
+ _exit(RERR_PARTIAL);