fix: cluster monitor rate, topics calculate error

This commit is contained in:
DDDHuang 2022-04-29 11:11:03 +08:00
parent 99452868ca
commit 9d1afa06c4
1 changed files with 6 additions and 3 deletions

View File

@ -252,9 +252,12 @@ merge_cluster_sampler_map(M1, M2) ->
merge_cluster_rate(Node, Cluster) ->
Fun =
fun(Key, Value, NCluster) ->
ClusterValue = maps:get(Key, NCluster, 0),
NCluster#{Key => Value + ClusterValue}
fun
(topics, Value, NCluster) ->
NCluster#{topics => Value};
(Key, Value, NCluster) ->
ClusterValue = maps:get(Key, NCluster, 0),
NCluster#{Key => Value + ClusterValue}
end,
maps:fold(Fun, Cluster, Node).