41 char const *op = stats->
op;
48 len = snprintf(buf, size,
"%s statistics: ", op);
52 snprintf(buf + len, size - (
size_t)len,
53 "literal[%d cmds, " FMT_LONG
" bytes, " FMT_LONG
58 if (stats->sig_cmds) {
60 snprintf(buf + len, size - (
size_t)len,
61 "in-place-signature[" FMT_LONG
" cmds, " FMT_LONG
62 " bytes] ", stats->sig_cmds, stats->sig_bytes);
65 if (stats->copy_cmds || stats->false_matches) {
67 snprintf(buf + len, size - (
size_t)len,
68 "copy[" FMT_LONG
" cmds, " FMT_LONG
" bytes, " FMT_LONG
69 " cmdbytes, %d false]", stats->copy_cmds,
70 stats->copy_bytes, stats->copy_cmdbytes,
71 stats->false_matches);
76 snprintf(buf + len, size - (
size_t)len,
77 "signature[" FMT_LONG
" blocks, " FMT_SIZE
78 " bytes per block]", stats->
sig_blocks, stats->block_len);
81 sec = (int)(stats->end - stats->start);
84 mb_in = (double)stats->
in_bytes / 1e6;
86 snprintf(buf + len, size - (
size_t)len,
87 " speed[%.1f MB (%.1f MB/s) in, %.1f MB (%.1f MB/s) out, %d sec]",
88 mb_in, mb_in / sec, mb_out, mb_out / sec, sec);
Public header for librsync.
@ RS_LOG_INFO
Informational.
int rs_log_stats(rs_stats_t const *stats)
Write statistics into the current log as text.
char * rs_format_stats(rs_stats_t const *stats, char *buf, size_t size)
Return a human-readable representation of statistics.
Performance statistics from a librsync encoding or decoding operation.
int lit_cmds
Number of literal commands.
rs_long_t lit_cmdbytes
Number of bytes used in literal command headers.
char const * op
Human-readable name of current operation.
rs_long_t sig_blocks
Number of blocks described by the signature.
rs_long_t out_bytes
Total bytes written to output.
rs_long_t lit_bytes
Number of literal bytes.
rs_long_t in_bytes
Total bytes read from input.
@ RS_LOG_NONAME
Don't show function name in message.