Skip to content

Commit

Permalink
c/topic_table_probe: use btree_map in topic table probe
Browse files Browse the repository at this point in the history
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 <michal@redpanda.com>
(cherry picked from commit 471f036)
  • Loading branch information
mmaslankaprv authored and vbotbuildovich committed Feb 29, 2024
1 parent 0785122 commit ada518c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/v/cluster/topic_table_probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "cluster/fwd.h"
#include "ssx/metrics.h"

#include <absl/container/btree_map.h>
#include <absl/container/flat_hash_set.h>

namespace cluster {
Expand Down Expand Up @@ -49,7 +50,7 @@ class topic_table_probe {

const topic_table& _topic_table;
model::node_id _node_id;
absl::flat_hash_map<model::topic_namespace, ss::metrics::metric_groups>
absl::btree_map<model::topic_namespace, ss::metrics::metric_groups>
_topics_metrics;
ss::metrics::metric_groups _internal_metrics;
ss::metrics::metric_groups _public_metrics{
Expand Down

0 comments on commit ada518c

Please sign in to comment.