diff --git a/cache_flat_mutation_reader.hh b/cache_flat_mutation_reader.hh index 74723ff38d..579f9ff649 100644 --- a/cache_flat_mutation_reader.hh +++ b/cache_flat_mutation_reader.hh @@ -619,6 +619,8 @@ void cache_flat_mutation_reader::add_to_buffer(const partition_snapshot_row_curs if (!row.dummy()) { _read_context->cache().on_row_hit(); add_clustering_row_to_buffer(mutation_fragment(*_schema, _permit, row.row(_read_context->digest_requested()))); + } else { + _read_context->cache()._tracker.on_dummy_row_hit(); } } diff --git a/row_cache.cc b/row_cache.cc index ae09e19c96..cc3668212a 100644 --- a/row_cache.cc +++ b/row_cache.cc @@ -108,6 +108,7 @@ cache_tracker::setup_metrics() { sm::make_derive("partition_misses", sm::description("number of partitions needed by reads and missing in cache"), _stats.partition_misses), sm::make_derive("partition_insertions", sm::description("total number of partitions added to cache"), _stats.partition_insertions), sm::make_derive("row_hits", sm::description("total number of rows needed by reads and found in cache"), _stats.row_hits), + sm::make_derive("dummy_row_hits", sm::description("total number of dummy rows touched by reads in cache"), _stats.dummy_row_hits), sm::make_derive("row_misses", sm::description("total number of rows needed by reads and missing in cache"), _stats.row_misses), sm::make_derive("row_insertions", sm::description("total number of rows added to cache"), _stats.row_insertions), sm::make_derive("row_evictions", sm::description("total number of rows evicted from cache"), _stats.row_evictions), @@ -200,6 +201,10 @@ void cache_tracker::on_row_hit() noexcept { ++_stats.row_hits; } +void cache_tracker::on_dummy_row_hit() noexcept { + ++_stats.dummy_row_hits; +} + void cache_tracker::on_row_miss() noexcept { ++_stats.row_misses; } diff --git a/row_cache.hh b/row_cache.hh index 6767b840a7..9b612f098c 100644 --- a/row_cache.hh +++ b/row_cache.hh @@ -165,6 +165,7 @@ public: uint64_t partition_hits; uint64_t partition_misses; uint64_t row_hits; + uint64_t dummy_row_hits; uint64_t row_misses; uint64_t partition_insertions; uint64_t row_insertions; @@ -221,6 +222,7 @@ public: void on_partition_eviction() noexcept; void on_row_eviction() noexcept; void on_row_hit() noexcept; + void on_dummy_row_hit() noexcept; void on_row_miss() noexcept; void on_miss_already_populated() noexcept; void on_mispopulate() noexcept;