42 char const *op = stats->
op;
49 len = snprintf(buf, size,
"%s statistics: ", op);
53 snprintf(buf + len, size - (
size_t)len,
54 "literal[%d cmds, " FMT_LONG
" bytes, " FMT_LONG
59 if (stats->sig_cmds) {
61 snprintf(buf + len, size - (
size_t)len,
62 "in-place-signature[" FMT_LONG
" cmds, " FMT_LONG
63 " bytes] ", stats->sig_cmds, stats->sig_bytes);
66 if (stats->copy_cmds || stats->false_matches) {
68 snprintf(buf + len, size - (
size_t)len,
69 "copy[" FMT_LONG
" cmds, " FMT_LONG
" bytes, " FMT_LONG
70 " cmdbytes, %d false]", stats->copy_cmds,
71 stats->copy_bytes, stats->copy_cmdbytes,
72 stats->false_matches);
77 snprintf(buf + len, size - (
size_t)len,
78 "signature[" FMT_LONG
" blocks, " FMT_SIZE
79 " bytes per block]", stats->
sig_blocks, stats->block_len);
82 sec = (int)(stats->end - stats->start);
85 mb_in = (double)stats->
in_bytes / 1e6;
87 snprintf(buf + len, size - (
size_t)len,
88 " speed[%.1f MB (%.1f MB/s) in, %.1f MB (%.1f MB/s) out, %d sec]",
89 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.