From ada518c01562acd1e1ed5c581294344db387a526 Mon Sep 17 00:00:00 2001 From: Michal Maslanka Date: Thu, 29 Feb 2024 12:21:40 +0100 Subject: [PATCH] c/topic_table_probe: use btree_map in topic table probe Replaced `absl::flat_hash_map` that was used in `topic_table_probe` with the `btree_map` to avoid large allocations when we deal with large number of topics. Signed-off-by: Michal Maslanka (cherry picked from commit 471f0366624eff6dc19dfb1f474bc2c3c55505df) --- src/v/cluster/topic_table_probe.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/v/cluster/topic_table_probe.h b/src/v/cluster/topic_table_probe.h index d1f9d080a8306..3f5bd5779c0b1 100644 --- a/src/v/cluster/topic_table_probe.h +++ b/src/v/cluster/topic_table_probe.h @@ -13,6 +13,7 @@ #include "cluster/fwd.h" #include "ssx/metrics.h" +#include #include namespace cluster { @@ -49,7 +50,7 @@ class topic_table_probe { const topic_table& _topic_table; model::node_id _node_id; - absl::flat_hash_map + absl::btree_map _topics_metrics; ss::metrics::metric_groups _internal_metrics; ss::metrics::metric_groups _public_metrics{