diff --git a/src/v/cluster/health_monitor_types.cc b/src/v/cluster/health_monitor_types.cc index 4c4183dc138f5..cfec6acc7ce05 100644 --- a/src/v/cluster/health_monitor_types.cc +++ b/src/v/cluster/health_monitor_types.cc @@ -263,4 +263,24 @@ std::ostream& operator<<(std::ostream& o, const get_cluster_health_reply& r) { return o; } +std::ostream& operator<<(std::ostream& o, const cluster_health_overview& ho) { + fmt::print( + o, + "{{controller_id: {}, nodes: {}, unhealthy_reasons: {}, nodes_down: {}, " + "nodes_in_recovery_mode: {}, bytes_in_cloud_storage: {}, " + "leaderless_count: {}, under_replicated_count: {}, " + "leaderless_partitions: {}, under_replicated_partitions: {}}}", + ho.controller_id, + ho.all_nodes, + ho.unhealthy_reasons, + ho.nodes_down, + ho.nodes_in_recovery_mode, + ho.bytes_in_cloud_storage, + ho.leaderless_count, + ho.under_replicated_count, + ho.leaderless_partitions, + ho.under_replicated_partitions); + return o; +} + } // namespace cluster diff --git a/src/v/cluster/health_monitor_types.h b/src/v/cluster/health_monitor_types.h index 738a7f4c01430..9b58705c9682d 100644 --- a/src/v/cluster/health_monitor_types.h +++ b/src/v/cluster/health_monitor_types.h @@ -276,6 +276,9 @@ struct cluster_health_overview { std::vector under_replicated_partitions; size_t under_replicated_count{}; std::optional bytes_in_cloud_storage; + + friend std::ostream& + operator<<(std::ostream&, const cluster_health_overview&); }; using include_partitions_info = ss::bool_class;