Skip to content

Commit

Permalink
row_cache: count read row tombstones
Browse files Browse the repository at this point in the history
Refs scylladb#7749.

Signed-off-by: Michael Livshin <[email protected]>
  • Loading branch information
Michael Livshin committed Aug 1, 2021
1 parent d4a5508 commit f364666
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cache_flat_mutation_reader.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions db/cache_tracker.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions row_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
});
}

Expand Down

0 comments on commit f364666

Please sign in to comment.