librsync  2.3.4
stats.md
1 # Stats {#api_stats}
2 
3 Encoding and decoding routines accumulate compression performance
4 statistics, such as the number of bytes read and written, indicators
5 a ::rs_stats_t structure.
6 
7 The particular statistics collected depend on the type
8 of job.
9 
10 Stats may be
11 converted to human-readable form or written to the log file using
12 ::rs_format_stats() or ::rs_log_stats() respectively.
13 
14 Statistics are held in a structure referenced by the job object. The
15 statistics are kept up-to-date as the job runs and so can be used for
16 progress indicators.
17 
18 ::rs_job_statistics returns a pointer to statistics for the job. The
19 pointer is valid throughout the life of the job, until the job is freed.
20 The statistics are updated during processing and can be used to measure
21 progress.
22 
23 Whole-file functions write statistics into a structure supplied by the caller.
24 \c NULL may be passed as the \p stats pointer if you don't want the stats.
LIBRSYNC_EXPORT int rs_log_stats(rs_stats_t const *stats)
Write statistics into the current log as text.
Definition: stats.c:31
struct rs_stats rs_stats_t
Performance statistics from a librsync encoding or decoding operation.
LIBRSYNC_EXPORT const rs_stats_t * rs_job_statistics(rs_job_t *job)
Return a pointer to the statistics in a job.
Definition: job.c:134
LIBRSYNC_EXPORT char * rs_format_stats(rs_stats_t const *stats, char *buf, size_t size)
Return a human-readable representation of statistics.
Definition: stats.c:40