row_cache: count read row tombstones

Refs #7749.

Signed-off-by: Michael Livshin <michael.livshin@scylladb.com>
This commit is contained in:
Michael Livshin
2021-07-03 22:47:35 +03:00
parent d4a5508d47
commit f364666d4a
3 changed files with 7 additions and 0 deletions

View File

@@ -701,6 +701,9 @@ void cache_flat_mutation_reader::add_clustering_row_to_buffer(mutation_fragment&
push_mutation_fragment(std::move(mf));
_lower_bound = std::move(new_lower_bound);
_lower_bound_changed = true;
if (row.tomb()) {
_read_context.cache()._tracker.on_row_tombstone_read();
}
}
inline

View File

@@ -78,6 +78,7 @@ public:
uint64_t reads_done;
uint64_t pinned_dirty_memory_overload;
uint64_t range_tombstone_reads;
uint64_t row_tombstone_reads;
uint64_t active_reads() const {
return reads - reads_done;
@@ -120,6 +121,7 @@ public:
void on_row_dropped_from_memtable() noexcept { ++_stats.rows_dropped_from_memtable; }
void on_row_merged_from_memtable() noexcept { ++_stats.rows_merged_from_memtable; }
void on_range_tombstone_read() noexcept { ++_stats.range_tombstone_reads; }
void on_row_tombstone_read() noexcept { ++_stats.row_tombstone_reads; }
void pinned_dirty_memory_overload(uint64_t bytes) noexcept;
allocation_strategy& allocator() noexcept;
logalloc::region& region() noexcept;

View File

@@ -138,6 +138,8 @@ cache_tracker::setup_metrics() {
sm::description("total number of rows in memtables which were merged with existing rows during cache update on memtable flush")),
sm::make_derive("range_tombstone_reads", _stats.range_tombstone_reads,
sm::description("total amount of range tombstones processed during read")),
sm::make_derive("row_tombstone_reads", _stats.row_tombstone_reads,
sm::description("total amount of row tombstones processed during read")),
});
}