TSG-1806 tfe.conf/future.conf 均增加 statsd_format 配置项,用于调整 fieldstat 输出格式

This commit is contained in:
luwenpeng
2020-06-18 14:08:05 +08:00
parent cf42953af5
commit 7c23dca564
4 changed files with 22 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ struct future_promise_instance
long long f_num;
int no_stats;
int statsd_cycle;
int statsd_format;
MESA_htable_handle name_table;
char statsd_server_ip[256];
int statsd_server_port;
@@ -74,6 +75,8 @@ void future_promise_library_init(const char* profile)
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);
// FS_OUTPUT_STATSD=1, FS_OUTPUT_INFLUX_LINE=2
MESA_load_profile_int_def(profile, "STAT", "statsd_format", &(g_FP_instance.statsd_format), 1);
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",
@@ -89,6 +92,10 @@ void future_promise_library_init(const char* profile)
return;
}
if (g_FP_instance.statsd_format != 1 && g_FP_instance.statsd_format != 2)
{
g_FP_instance.statsd_format = 1;
}
MESA_htable_handle htable = MESA_htable_born();
value=0;
@@ -119,6 +126,7 @@ void future_promise_library_init(const char* profile)
{
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_PORT, &(g_FP_instance.statsd_server_port), sizeof(g_FP_instance.statsd_server_port));
FS_set_para(fs, STATS_FORMAT, &(g_FP_instance.statsd_format), sizeof(g_FP_instance.statsd_format));
}
FS_set_para(fs, HISTOGRAM_GLOBAL_BINS, g_FP_instance.histogram_bins, strlen(g_FP_instance.histogram_bins)+1);
g_FP_instance.fsid_f_num=FS_register(fs, FS_STYLE_FIELD, g_FP_instance.favorite, "futures");