Merge pull request #7833 from DDDHuang/testm_cluster

fix: cluster monitor rate, topics calculate error
This commit is contained in:
DDDHuang 2022-04-29 13:45:35 +08:00 committed by GitHub
commit 177926b0a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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).