From 9b470a367c5cd4d1fd9c177f9ec4a2e21c517e5f Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Mon, 15 Jul 2024 14:40:22 -0700 Subject: [PATCH] Add check_bytes_total counter --- ConflictSet.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 50f9986..85d99e4 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -3077,8 +3077,10 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { int commits_accum = 0; int conflicts_accum = 0; int too_olds_accum = 0; + double check_byte_accum = 0; for (int i = 0; i < count; ++i) { const auto &r = reads[i]; + check_byte_accum += r.begin.len + r.end.len; auto begin = std::span(r.begin.p, r.begin.len); auto end = std::span(r.end.p, r.end.len); assert(oldestVersionFullPrecision >= @@ -3116,6 +3118,7 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { commits_total.add(commits_accum); conflicts_total.add(conflicts_accum); too_olds_total.add(too_olds_accum); + check_bytes_total.add(check_byte_accum); } void addWrites(const WriteRange *writes, int count, int64_t writeVersion) { @@ -3329,6 +3332,7 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { "Total number of checks where the result is \"conflict\""); COUNTER(too_olds_total, "Total number of checks where the result is \"too old\""); + COUNTER(check_bytes_total, "Total number of key bytes checked"); // ==================== END METRICS DEFINITIONS ==================== #undef GAUGE #undef COUNTER