From 2af69ecebd795d027a977ac2566a5c30eaa1d42b Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Thu, 23 May 2024 00:03:21 +0800 Subject: [PATCH] feat: Normalize the output format of 'balance_operation_count' --- src/meta/greedy_load_balancer.cpp | 2 +- src/meta/meta_service.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meta/greedy_load_balancer.cpp b/src/meta/greedy_load_balancer.cpp index 81d7482bd9..535e3fbe63 100644 --- a/src/meta/greedy_load_balancer.cpp +++ b/src/meta/greedy_load_balancer.cpp @@ -104,7 +104,7 @@ std::string greedy_load_balancer::get_balance_operation_count(const std::vector< } else { info["error"] = fmt::format("invalid arguments"); } - return info.dump(2); + return info.dump(); } void greedy_load_balancer::score(meta_view view, double &primary_stddev, double &total_stddev) diff --git a/src/meta/meta_service.cpp b/src/meta/meta_service.cpp index b619bd55b7..0e0a80f0c9 100644 --- a/src/meta/meta_service.cpp +++ b/src/meta/meta_service.cpp @@ -736,7 +736,7 @@ void meta_service::on_query_cluster_info(configuration_cluster_info_rpc rpc) _meta_function_level_VALUES_TO_NAMES.find(get_function_level())->second + 3); response.keys.push_back("balance_operation_count"); std::vector balance_operation_type; - balance_operation_type.emplace_back(std::string("detail")); + balance_operation_type.emplace_back("detail"); response.values.push_back(_balancer->get_balance_operation_count(balance_operation_type)); double primary_stddev, total_stddev; _state->get_cluster_balance_score(primary_stddev, total_stddev);