forked from weaselab/conflict-set
Add check_bytes_total counter
This commit is contained in:
@@ -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<const uint8_t>(r.begin.p, r.begin.len);
|
||||
auto end = std::span<const uint8_t>(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
|
||||
|
||||
Reference in New Issue
Block a user