Print cache hit percentage - 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 b8b0b8ba4b138cb9bbf631e21435ee7c9034e25b
DIR parent 4b9498e7eb0396140d4e814f01e1bebb18c9aa77
HTML Author: sin <sin@2f30.org>
Date: Mon, 1 Apr 2019 15:29:52 +0100
Print cache hit percentage
Diffstat:
M dedup.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
DIR diff --git a/dedup.c b/dedup.c
@@ -68,9 +68,9 @@ print_stats(struct stats *st)
(unsigned long long)st->max_blk_size);
fprintf(stderr, "Number of unique blocks: %llu\n",
(unsigned long long)st->nr_blks);
- icache_stats(icache, &hits, &misses);
- fprintf(stderr, "Index cache hits: %llu\n", hits);
- fprintf(stderr, "Index cache hits: %llu\n", misses);
+ icache_stats(icache, &hits, &misses);
+ fprintf(stderr, "Index cache hit percentage: %.2f%%\n",
+ (double)100 * (hits / (hits + misses)));
}
static struct snap *