32 #ifdef HAVE_SYS_FILE_H
33 # include <sys/file.h>
51 char const *op = stats->
op;
53 double mbps_in, mbps_out;
58 len = snprintf(buf, size,
"%s statistics: ", op);
62 snprintf(buf + len, size - len,
63 "literal[%d cmds, " FMT_LONG
" bytes, " FMT_LONG
68 if (stats->sig_cmds) {
70 snprintf(buf + len, size - len,
71 "in-place-signature[" FMT_LONG
" cmds, " FMT_LONG
72 " bytes] ", stats->sig_cmds, stats->sig_bytes);
75 if (stats->copy_cmds || stats->false_matches) {
77 snprintf(buf + len, size - len,
78 "copy[" FMT_LONG
" cmds, " FMT_LONG
" bytes, " FMT_LONG
79 " cmdbytes, %d false]", stats->copy_cmds,
80 stats->copy_bytes, stats->copy_cmdbytes,
81 stats->false_matches);
86 snprintf(buf + len, size - len,
87 "signature[" FMT_LONG
" blocks, " FMT_SIZE
88 " bytes per block]", stats->
sig_blocks, stats->block_len);
91 sec = (stats->end - stats->start);
94 mbps_in = stats->
in_bytes / 1e6 / sec;
97 snprintf(buf + len, size - len,
98 " speed[%.1f MB (%.1f MB/s) in, %.1f MB (%.1f MB/s) out, %d sec]",
rs_long_t lit_cmdbytes
Number of bytes used in literal command headers.
rs_long_t sig_blocks
Number of blocks described by the signature.
rs_long_t out_bytes
Total bytes written to output.
Don't show function name in message.
rs_long_t in_bytes
Total bytes read from input.
Public header for librsync.
int lit_cmds
Number of literal commands.
char const * op
Human-readable name of current operation.
rs_long_t lit_bytes
Number of literal bytes.
Performance statistics from a librsync encoding or decoding operation.
char * rs_format_stats(rs_stats_t const *stats, char *buf, size_t size)
Return a human-readable representation of statistics.
int rs_log_stats(rs_stats_t const *stats)
Write statistics into the current log as text.