mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-22 15:52:13 +00:00
sstables stats: partition seeks
Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
@@ -269,7 +269,9 @@ private:
|
||||
return make_ready_future<>();
|
||||
}
|
||||
assert(_index_reader->element_kind() == indexable_element::partition);
|
||||
return _context->skip_to(_index_reader->element_kind(), start);
|
||||
return _context->skip_to(_index_reader->element_kind(), start).then([this] {
|
||||
_sst->get_stats().on_partition_seek();
|
||||
});
|
||||
});
|
||||
}
|
||||
future<> read_from_index() {
|
||||
@@ -381,6 +383,7 @@ private:
|
||||
return make_ready_future<>();
|
||||
}
|
||||
return _context->skip_to(idx.element_kind(), index_position.start).then([this, &idx] {
|
||||
_sst->get_stats().on_partition_seek();
|
||||
set_range_tombstone_start_from_end_open_marker(_consumer, *_schema, idx);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4300,6 +4300,8 @@ future<> init_metrics() {
|
||||
sm::description("Number of whole sstable flat mutation reads")),
|
||||
sm::make_derive("partition_reads", [] { return sstables_stats::get_shard_stats().partition_reads; },
|
||||
sm::description("Number of partitions read")),
|
||||
sm::make_derive("partition_seeks", [] { return sstables_stats::get_shard_stats().partition_seeks; },
|
||||
sm::description("Number of partitions seeked")),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ class sstables_stats {
|
||||
uint64_t range_partition_reads = 0;
|
||||
uint64_t sstable_partition_reads = 0;
|
||||
uint64_t partition_reads = 0;
|
||||
uint64_t partition_seeks = 0;
|
||||
} _shard_stats;
|
||||
|
||||
stats& _stats = _shard_stats;
|
||||
@@ -88,6 +89,10 @@ public:
|
||||
inline void on_partition_read() {
|
||||
++_stats.partition_reads;
|
||||
}
|
||||
|
||||
inline void on_partition_seek() {
|
||||
++_stats.partition_seeks;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user