summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2021-08-28 02:43:38 -0700
committerVito Caputo <vcaputo@pengaru.com>2021-08-28 02:43:38 -0700
commitc3263f3e66074d4332f87f1a29e361c96539eec7 (patch)
tree1bf1ab9d13dd319814a94037f69b99097d568a28 /src
parent2b6654a23925a3ce9d596030e6eebcf543eddbd5 (diff)
verify-hashed-objects: add byte counts to summary
Still dubious of crazy short cached runtime, there must be a bug here Should probably just add a cumulative digest per journal
Diffstat (limited to 'src')
-rw-r--r--src/verify-hashed-objects.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/verify-hashed-objects.c b/src/verify-hashed-objects.c
index 3328dd2..8146217 100644
--- a/src/verify-hashed-objects.c
+++ b/src/verify-hashed-objects.c
@@ -27,6 +27,7 @@
#include <iou.h>
#include <thunk.h>
+#include "humane.h"
#include "journals.h"
#include "machid.h"
#include "verify-hashed-objects.h"
@@ -44,6 +45,7 @@
/* just some basic counters to aid in sanity checking this thing is actually doing work */
typedef struct verify_stats_t {
uint64_t n_field_objects, n_data_objects;
+ uint64_t n_field_bytes, n_data_bytes;
} verify_stats_t;
/* borrowed from systemd */
@@ -138,11 +140,13 @@ THUNK_DEFINE_STATIC(verify_hashed_object, journal_t *, journal, Header *, header
payload_size = o->object.size - offsetof(FieldObject, payload),
payload = o->field.payload;
stats->n_field_objects++;
+ stats->n_field_bytes += payload_size;
break;
case OBJECT_DATA:
payload_size = o->object.size - offsetof(DataObject, payload),
payload = o->data.payload;
stats->n_data_objects++;
+ stats->n_data_bytes += payload_size;
break;
default:
assert(0);
@@ -213,11 +217,18 @@ THUNK_DEFINE_STATIC(per_object, thunk_t *, self, iou_t *, iou, journal_t **, jou
assert(stats);
if (!*iter_offset) {
+ humane_t h1, h2;
+
free(*iter_object);
free(*decompressed);
*iter_object = *decompressed = NULL;
- printf("\"%s\" finished: n_field_objects=%"PRIu64" n_data_objects=%"PRIu64"\n",
- (*journal)->name, stats->n_field_objects, stats->n_data_objects);
+
+ printf("\"%s\" finished: field_objects=%"PRIu64"(%s) data_objects=%"PRIu64"(%s)\n",
+ (*journal)->name,
+ stats->n_field_objects,
+ humane_bytes(&h1, stats->n_field_bytes),
+ stats->n_data_objects,
+ humane_bytes(&h2, stats->n_data_bytes));
return 0;
}
© All Rights Reserved