summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2021-08-15 16:14:35 -0700
committerVito Caputo <vcaputo@pengaru.com>2021-08-15 16:14:35 -0700
commit851c0fcbbd1eb4bc69ee7982ec953699459269a4 (patch)
tree1fb99d40b4df9aeff4a704319ee943139b8c282d /src
parent92766558d7eefdee3e329e0a380a2f2da47c0d80 (diff)
report-entry-arrays: add %age to Unique EAs line
The bucketized counts already have %ages, but not the overall count.
Diffstat (limited to 'src')
-rw-r--r--src/report-entry-arrays.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/report-entry-arrays.c b/src/report-entry-arrays.c
index 39ef76d..edf138a 100644
--- a/src/report-entry-arrays.c
+++ b/src/report-entry-arrays.c
@@ -61,7 +61,7 @@ typedef struct entry_array_t {
} entry_array_t;
typedef struct entry_array_stats_t {
- uint64_t count, uniq;
+ uint64_t count, unique;
entry_array_t *buckets[N_BUCKETS];
} entry_array_stats_t;
@@ -118,7 +118,7 @@ THUNK_DEFINE_STATIC(per_entry_array_payload, iou_t *, iou, iou_op_t *, op, uint6
ea->size = payload_size;
ea->next = stats->buckets[bucket];
stats->buckets[bucket] = ea;
- stats->uniq++;
+ stats->unique++;
}
ea->count++;
@@ -188,7 +188,7 @@ THUNK_DEFINE_STATIC(per_object, thunk_t *, self, uint64_t *, iter_offset, Object
printf("\n\nEntry-array stats for \"%s\":\n", (*journal)->name);
printf(" Total EAs: %"PRIu64"\n", stats->count);
- printf(" Unique EAs: %"PRIu64"\n", stats->uniq);
+ printf(" Unique EAs: %"PRIu64" (%%%.1f)\n", stats->unique, stats->count ? (float)stats->unique / (float)stats->count * 100.f : 0.f);
printf(" log2(size) counts (%%unique[total,unique] ...): ");
for (int i = 0; i < 64; i++) {
© All Rights Reserved