[QUEUED scylla next] sstables: mx: add pi_auto_scale_events metric

0 views
Skip to first unread message

Commit Bot

<bot@cloudius-systems.com>
unread,
May 25, 2022, 3:27:43 AM5/25/22
to scylladb-dev@googlegroups.com, Benny Halevy
From: Benny Halevy <bha...@scylladb.com>
Committer: Benny Halevy <bha...@scylladb.com>
Branch: next

sstables: mx: add pi_auto_scale_events metric

Counts the number of promoted index auto-scale events.

A large number of those, relative to `partition_writes`,
indicates that `column_index_size_in_kb` should be increased.

Signed-off-by: Benny Halevy <bha...@scylladb.com>

---
diff --git a/sstables/mx/writer.cc b/sstables/mx/writer.cc
--- a/sstables/mx/writer.cc
+++ b/sstables/mx/writer.cc
@@ -857,6 +857,7 @@ void writer::add_pi_block() {
if (_pi_write_m.blocks.size() >= _pi_write_m.auto_scale_threshold) {
_pi_write_m.desired_block_size *= 2;
_pi_write_m.auto_scale_threshold += _pi_write_m.promoted_index_auto_scale_threshold;
+ _sst.get_stats().on_promoted_index_auto_scale();
}
}

diff --git a/sstables/sstables.cc b/sstables/sstables.cc
--- a/sstables/sstables.cc
+++ b/sstables/sstables.cc
@@ -3112,6 +3112,9 @@ future<> init_metrics() {
sm::description("Number of tombstones written")),
sm::make_counter("range_tombstone_writes", [] { return sstables_stats::get_shard_stats().range_tombstone_writes; },
sm::description("Number of range tombstones written")),
+ sm::make_counter("pi_auto_scale_events", [] { return sstables_stats::get_shard_stats().promoted_index_auto_scale_events; },
+ sm::description("Number of promoted index auto-scaling events")),
+
sm::make_counter("range_tombstone_reads", [] { return sstables_stats::get_shard_stats().range_tombstone_reads; },
sm::description("Number of range tombstones read")),
sm::make_counter("row_tombstone_reads", [] { return sstables_stats::get_shard_stats().row_tombstone_reads; },
diff --git a/sstables/stats.hh b/sstables/stats.hh
--- a/sstables/stats.hh
+++ b/sstables/stats.hh
@@ -35,6 +35,7 @@ class sstables_stats {
uint64_t open_for_writing = 0;
uint64_t closed_for_writing = 0;
uint64_t deleted = 0;
+ uint64_t promoted_index_auto_scale_events = 0;
} _shard_stats;

stats& _stats = _shard_stats;
@@ -125,6 +126,10 @@ public:
inline void on_delete() noexcept {
++_stats.deleted;
}
+
+ inline void on_promoted_index_auto_scale() noexcept {
+ ++_stats.promoted_index_auto_scale_events;
+ }
};

}

Commit Bot

<bot@cloudius-systems.com>
unread,
May 25, 2022, 2:57:02 PM5/25/22
to scylladb-dev@googlegroups.com, Benny Halevy
From: Benny Halevy <bha...@scylladb.com>
Committer: Benny Halevy <bha...@scylladb.com>
Branch: master
Reply all
Reply to author
Forward
0 new messages