TSG-1806 tfe.conf/future.conf 均增加 statsd_cycle 配置项,用于调整 fieldstat 输出周期
This commit is contained in:
@@ -18,6 +18,7 @@ struct future_promise_instance
|
|||||||
int fsid_f_num;
|
int fsid_f_num;
|
||||||
long long f_num;
|
long long f_num;
|
||||||
int no_stats;
|
int no_stats;
|
||||||
|
int statsd_cycle;
|
||||||
MESA_htable_handle name_table;
|
MESA_htable_handle name_table;
|
||||||
char statsd_server_ip[256];
|
char statsd_server_ip[256];
|
||||||
int statsd_server_port;
|
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",
|
MESA_load_profile_string_def(profile, "STAT", "statsd_server",
|
||||||
g_FP_instance.statsd_server_ip, sizeof(g_FP_instance.statsd_server_ip), "");
|
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_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",
|
MESA_load_profile_string_def(profile, "STAT", "histogram_bins",
|
||||||
g_FP_instance.histogram_bins, sizeof(g_FP_instance.histogram_bins), FP_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",
|
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));
|
FS_set_para(fs, PRINT_MODE, &value, sizeof(value));
|
||||||
value=1;
|
value=1;
|
||||||
FS_set_para(fs, CREATE_THREAD, &value, sizeof(value));
|
FS_set_para(fs, CREATE_THREAD, &value, sizeof(value));
|
||||||
value=2;
|
FS_set_para(fs, STAT_CYCLE, &g_FP_instance.statsd_cycle, sizeof(g_FP_instance.statsd_cycle));
|
||||||
FS_set_para(fs, STAT_CYCLE, &value, sizeof(value));
|
|
||||||
if(strlen(g_FP_instance.statsd_server_ip)>0 && g_FP_instance.statsd_server_port!=0)
|
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);
|
FS_set_para(fs, STATS_SERVER_IP, g_FP_instance.statsd_server_ip, strlen(g_FP_instance.statsd_server_ip)+1);
|
||||||
|
|||||||
@@ -2,4 +2,5 @@
|
|||||||
no_stats=0
|
no_stats=0
|
||||||
statsd_server=192.168.10.72
|
statsd_server=192.168.10.72
|
||||||
statsd_port=8092
|
statsd_port=8092
|
||||||
histogram_bins=0.50,0.80,0.9,0.95
|
histogram_bins=0.50,0.80,0.9,0.95
|
||||||
|
statsd_cycle=2
|
||||||
@@ -71,6 +71,7 @@ level=10
|
|||||||
[stat]
|
[stat]
|
||||||
statsd_server=192.168.10.72
|
statsd_server=192.168.10.72
|
||||||
statsd_port=8126
|
statsd_port=8126
|
||||||
|
statsd_cycle=2
|
||||||
|
|
||||||
[http]
|
[http]
|
||||||
loglevel=20
|
loglevel=20
|
||||||
|
|||||||
@@ -707,8 +707,9 @@ int main(int argc, char * argv[])
|
|||||||
CHECK_OR_EXIT(g_default_proxy->sev[i], "Failed at create signal event. Exit.");
|
CHECK_OR_EXIT(g_default_proxy->sev[i], "Failed at create signal event. Exit.");
|
||||||
evsignal_add(g_default_proxy->sev[i], NULL);
|
evsignal_add(g_default_proxy->sev[i], NULL);
|
||||||
}
|
}
|
||||||
|
int statsd_cycle = 0;
|
||||||
struct timeval gc_delay = {2, 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);
|
evtimer_add(g_default_proxy->gcev, &gc_delay);
|
||||||
|
|
||||||
/* WORKER THREAD CTX Create */
|
/* WORKER THREAD CTX Create */
|
||||||
|
|||||||
Reference in New Issue
Block a user