提交 944093b8 编写于 作者: W Wu Tao 提交者: neverchanje

refactor(config): remove duplicated config items for cluster name (#462)

上级 83d2f015
......@@ -8,12 +8,11 @@
#include <ios>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <unistd.h>
#include <dsn/utility/smart_pointers.h>
#include <dsn/cpp/service_app.h>
#include <dsn/dist/replication/duplication_common.h>
#include "base/pegasus_utils.h"
#include "pegasus_io_service.h"
......@@ -22,10 +21,6 @@
#include <map>
#include <memory>
#include <string>
#include <thread>
#include <sstream>
#include <iterator>
#include <regex>
using namespace ::dsn;
......@@ -140,9 +135,7 @@ void pegasus_counter_reporter::start()
_app_name = dsn::service_app::current_service_app_info().full_name;
_cluster_name = dsn_config_get_value_string(
"pegasus.server", "perf_counter_cluster_name", "", "perf_counter_cluster_name");
dassert(_cluster_name.size() > 0, "");
_cluster_name = dsn::replication::get_current_cluster_name();
_update_interval_seconds = dsn_config_get_value_uint64("pegasus.server",
"perf_counter_update_interval_seconds",
......@@ -355,5 +348,5 @@ void pegasus_counter_reporter::on_report_timer(std::shared_ptr<boost::asio::dead
dassert(false, "pegasus report timer error!!!");
}
}
}
} // namespace
} // namespace server
} // namespace pegasus
......@@ -7,6 +7,7 @@
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <dsn/dist/replication/duplication_common.h>
#include "base/pegasus_key_schema.h"
#include "result_writer.h"
......@@ -29,8 +30,7 @@ available_detector::available_detector()
_recent_minute_fail_times(0)
{
// initialize information for available_detector.
_cluster_name = dsn_config_get_value_string("pegasus.collector", "cluster", "", "cluster name");
dassert(_cluster_name.size() > 0, "");
_cluster_name = dsn::replication::get_current_cluster_name();
_app_name = dsn_config_get_value_string(
"pegasus.collector", "available_detect_app", "", "available detector app name");
dassert(_app_name.size() > 0, "");
......
......@@ -287,7 +287,6 @@
manual_compact_min_interval_seconds = 600
perf_counter_cluster_name = %{cluster.name}
perf_counter_update_interval_seconds = 10
perf_counter_enable_logging = false
perf_counter_enable_falcon = false
......@@ -303,8 +302,6 @@
prometheus_port = 9091
[pegasus.collector]
cluster = %{cluster.name}
available_detect_app = temp
available_detect_alert_script_dir = ./package/bin
available_detect_alert_email_address =
......
......@@ -100,6 +100,7 @@
mutation_2pc_min_replica_count = 1
cold_backup_root = onebox
duplication_disabled = true
cluster_name = onebox
[meta_server.apps.@APP_NAME@]
app_name = @APP_NAME@
......@@ -112,12 +113,9 @@
partition_count = 4
[pegasus.server]
perf_counter_cluster_name = onebox
perf_counter_enable_logging = false
[pegasus.collector]
cluster = onebox
available_detect_app = @APP_NAME@
available_detect_alert_script_dir = ./package/bin
usage_stat_app = stat
......
......@@ -6,18 +6,14 @@
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <vector>
#include <chrono>
#include <functional>
#include <dsn/tool-api/group_address.h>
#include <dsn/dist/replication/duplication_common.h>
#include "base/pegasus_utils.h"
#include "base/pegasus_const.h"
#include "result_writer.h"
#define METRICSNUM 3
using namespace ::dsn;
using namespace ::dsn::replication;
......@@ -42,8 +38,7 @@ info_collector::info_collector()
_meta_servers.group_address()->add(ms);
}
_cluster_name = dsn_config_get_value_string("pegasus.collector", "cluster", "", "cluster name");
dassert(!_cluster_name.empty(), "");
_cluster_name = dsn::replication::get_current_cluster_name();
_shell_context.current_cluster_name = _cluster_name;
_shell_context.meta_list = meta_servers;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册