summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2020-06-11 15:37:49 +0800
committerluwenpeng <[email protected]>2020-06-11 17:12:01 +0800
commit82f04dcc120b1c59b1ebe2fad7511d40cf5bb7b6 (patch)
treeb1e1a592ca9cdae5d67b9caac1668ef3522b1ef5
parent9614ea53c022b9fbf4468a22be5141fa63bb15b6 (diff)
TSG-1806 tfe.conf/future.conf 均增加 statsd_cycle 配置项,用于调整 fieldstat 输出周期v4.3.4-202006
-rw-r--r--common/src/tfe_future.cpp5
-rw-r--r--conf/tfe/future.conf3
-rw-r--r--conf/tfe/tfe.conf1
-rw-r--r--platform/src/proxy.cpp5
4 files changed, 9 insertions, 5 deletions
diff --git a/common/src/tfe_future.cpp b/common/src/tfe_future.cpp
index 3e3fc9f..922eadc 100644
--- a/common/src/tfe_future.cpp
+++ b/common/src/tfe_future.cpp
@@ -18,6 +18,7 @@ struct future_promise_instance
int fsid_f_num;
long long f_num;
int no_stats;
+ int statsd_cycle;
MESA_htable_handle name_table;
char statsd_server_ip[256];
int statsd_server_port;
@@ -72,6 +73,7 @@ void future_promise_library_init(const char* profile)
MESA_load_profile_string_def(profile, "STAT", "statsd_server",
g_FP_instance.statsd_server_ip, sizeof(g_FP_instance.statsd_server_ip), "");
MESA_load_profile_int_def(profile, "STAT", "statsd_port", &(g_FP_instance.statsd_server_port), 0);
+ MESA_load_profile_int_def(profile, "STAT", "statsd_cycle", &(g_FP_instance.statsd_cycle), 2);
MESA_load_profile_string_def(profile, "STAT", "histogram_bins",
g_FP_instance.histogram_bins, sizeof(g_FP_instance.histogram_bins), FP_HISTOGRAM_BINS);
MESA_load_profile_int_def(profile, "STAT", "print_diff",
@@ -112,8 +114,7 @@ void future_promise_library_init(const char* profile)
FS_set_para(fs, PRINT_MODE, &value, sizeof(value));
value=1;
FS_set_para(fs, CREATE_THREAD, &value, sizeof(value));
- value=2;
- FS_set_para(fs, STAT_CYCLE, &value, sizeof(value));
+ FS_set_para(fs, STAT_CYCLE, &g_FP_instance.statsd_cycle, sizeof(g_FP_instance.statsd_cycle));
if(strlen(g_FP_instance.statsd_server_ip)>0 && g_FP_instance.statsd_server_port!=0)
{
FS_set_para(fs, STATS_SERVER_IP, g_FP_instance.statsd_server_ip, strlen(g_FP_instance.statsd_server_ip)+1);
diff --git a/conf/tfe/future.conf b/conf/tfe/future.conf
index 5ea9aee..817aa66 100644
--- a/conf/tfe/future.conf
+++ b/conf/tfe/future.conf
@@ -2,4 +2,5 @@
no_stats=0
statsd_server=192.168.10.72
statsd_port=8092
-histogram_bins=0.50,0.80,0.9,0.95 \ No newline at end of file
+histogram_bins=0.50,0.80,0.9,0.95
+statsd_cycle=2 \ No newline at end of file
diff --git a/conf/tfe/tfe.conf b/conf/tfe/tfe.conf
index ae645ad..d8f8717 100644
--- a/conf/tfe/tfe.conf
+++ b/conf/tfe/tfe.conf
@@ -71,6 +71,7 @@ level=10
[stat]
statsd_server=192.168.10.72
statsd_port=8126
+statsd_cycle=2
[http]
loglevel=20
diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp
index a4663a6..4b3eac5 100644
--- a/platform/src/proxy.cpp
+++ b/platform/src/proxy.cpp
@@ -707,8 +707,9 @@ int main(int argc, char * argv[])
CHECK_OR_EXIT(g_default_proxy->sev[i], "Failed at create signal event. Exit.");
evsignal_add(g_default_proxy->sev[i], NULL);
}
-
- struct timeval gc_delay = {2, 0};
+ int statsd_cycle = 0;
+ MESA_load_profile_int_def(main_profile, "STAT", "statsd_cycle", &(statsd_cycle), 2);
+ struct timeval gc_delay = {statsd_cycle, 0};
evtimer_add(g_default_proxy->gcev, &gc_delay);
/* WORKER THREAD CTX Create */