From b45dec2f1ff9e342b9f07d4cb56799fca6d9a521 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Thu, 18 Jul 2024 14:00:57 -0700 Subject: [PATCH] Add point_writes_total and range_writes_total --- ConflictSet.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index a71e9ee..2db0bec 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -3194,6 +3194,8 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { } double write_byte_accum = 0; + int point_writes_accum = 0; + int range_writes_accum = 0; for (int i = 0; i < count; ++i) { const auto &w = writes[i]; write_byte_accum += w.begin.len + w.end.len; @@ -3201,15 +3203,19 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { auto end = std::span(w.end.p, w.end.len); if (w.end.len > 0) { keyUpdates += 3; + ++range_writes_accum; addWriteRange(root, begin, end, InternalVersionT(writeVersion), &tls, this); } else { keyUpdates += 2; + ++point_writes_accum; addPointWrite(root, begin, InternalVersionT(writeVersion), &tls, this); } } memory_bytes.set(totalBytes); + point_writes_total.add(point_writes_accum); + range_writes_total.add(range_writes_accum); nodes_allocated_total.add(std::exchange(tls.nodes_allocated_accum, 0)); nodes_released_total.add(std::exchange(tls.nodes_released_accum, 0)); entries_inserted_total.add(std::exchange(tls.entries_inserted_accum, 0)); @@ -3403,13 +3409,18 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { COUNTER(too_olds_total, "Total number of checks where the result is \"too old\""); COUNTER(check_bytes_total, "Total number of key bytes checked"); + COUNTER(point_writes_total, "Total number of point writes"); + COUNTER(range_writes_total, + "Total number of range writes (includes prefix writes)"); GAUGE(memory_bytes, "Total number of bytes in use"); COUNTER(nodes_allocated_total, "The total number of physical tree nodes allocated"); COUNTER(nodes_released_total, "The total number of physical tree nodes released"); COUNTER(insert_iterations_total, - "The total number of iterations of the main loop for insertion"); + "The total number of iterations of the main loop for insertion. " + "Includes searches where the entry already existed, and so insertion " + "did not take place"); COUNTER(entries_inserted_total, "The total number of entries inserted in the tree"); COUNTER(entries_erased_total,