Branch data Line data Source code
1 : : #include "precizer.h"
2 : :
3 : : /**
4 : : * @brief Print aggregated traversal totals from TraversalSummary.
5 : : *
6 : : * Emits a single totals line with allocated size and item counts
7 : : * (directories, files, symlinks).
8 : : *
9 : : * @param summary Traversal counters produced by file_list().
10 : : */
11 : 402 : void show_statistics(const TraversalSummary *summary)
12 : : {
13 : : // Don't do anything
14 [ + + ]: 402 : if(config->compare == true)
15 : : {
16 : 80 : return;
17 : : }
18 : :
19 [ + + + + ]: 322 : if(summary->stats_only_pass == false && summary->at_least_one_file_was_shown == false)
20 : : {
21 : 86 : return;
22 : : }
23 : :
24 : 236 : size_t total_items = summary->count_dirs
25 : 236 : + summary->count_files
26 : 236 : + summary->count_symlnks;
27 : :
28 : 236 : slog(EVERY,"Total allocated size: %s, total items: %zu, dirs: %zu, files: %zu, symlnks: %zu\n",
29 : : bkbmbgbtbpbeb(summary->total_allocated_bytes,FULL_VIEW),
30 : : total_items,
31 : : summary->count_dirs,
32 : : summary->count_files,
33 : : summary->count_symlnks);
34 : : }
|