dup-pack: Print index cache hit percentage in verbose mode - dedup - deduplicating backup program HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit bc7c1b2b360b2ca63845092283b61edc2b247231 DIR parent 75462091afc92997fb825e90d160bf5084b1242e HTML Author: sin <sin@2f30.org> Date: Thu, 18 Apr 2019 13:05:32 +0100 dup-pack: Print index cache hit percentage in verbose mode Diffstat: M dup-pack.c | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) --- DIR diff --git a/dup-pack.c b/dup-pack.c @@ -102,6 +102,16 @@ dedup(int fd, char *msg) } hash_snap(snap, snap->md, hash_algo); append_snap(ifd, &snap_hdr, snap); + + if (verbose > 0) { + unsigned long long hits, misses; + double hitratio; + + icache_stats(icache, &hits, &misses); + hitratio = (double)hits / (hits + misses); + fprintf(stderr, "Index cache hit percentage: %.2f%%\n", + 100 * hitratio); + } } free_chunker(chunker);