TSG-1806 tfe.conf/future.conf 均增加 statsd_format 配置项,用于调整 fieldstat 输出格式
This commit is contained in:
@@ -346,13 +346,21 @@ int tfe_stat_init(struct tfe_proxy * proxy, const char * profile)
|
||||
screen_stat_handle_t fs_handle = NULL;
|
||||
char statsd_server_ip[TFE_SYMBOL_MAX]={0};
|
||||
char histogram_bins[TFE_SYMBOL_MAX]={0};
|
||||
int statsd_format=0;
|
||||
int statsd_server_port=0;
|
||||
MESA_load_profile_string_def(profile, "STAT", "statsd_server", statsd_server_ip,
|
||||
sizeof(statsd_server_ip), "");
|
||||
MESA_load_profile_int_def(profile, "STAT", "statsd_port", &(statsd_server_port), 0);
|
||||
// FS_OUTPUT_STATSD=1, FS_OUTPUT_INFLUX_LINE=2
|
||||
MESA_load_profile_int_def(profile, "STAT", "statsd_format", &(statsd_format), 1);
|
||||
MESA_load_profile_string_def(profile, "STAT", "histogram_bins",
|
||||
histogram_bins, sizeof(histogram_bins), "0.5,0.8,0.9,0.95");
|
||||
|
||||
if (statsd_format != 1 && statsd_format != 2)
|
||||
{
|
||||
statsd_format = 1;
|
||||
}
|
||||
|
||||
fs_handle = FS_create_handle();
|
||||
FS_set_para(fs_handle, OUTPUT_DEVICE, fieldstat_output, (int)strlen(fieldstat_output) + 1);
|
||||
FS_set_para(fs_handle, APP_NAME, app_name, (int)strlen(app_name) + 1);
|
||||
@@ -365,6 +373,7 @@ int tfe_stat_init(struct tfe_proxy * proxy, const char * profile)
|
||||
{
|
||||
FS_set_para(fs_handle, STATS_SERVER_IP, statsd_server_ip, strlen(statsd_server_ip)+1);
|
||||
FS_set_para(fs_handle, STATS_SERVER_PORT, &(statsd_server_port), sizeof(statsd_server_port));
|
||||
FS_set_para(fs_handle, STATS_FORMAT, &statsd_format, sizeof(statsd_format));
|
||||
}
|
||||
FS_set_para(fs_handle, HISTOGRAM_GLOBAL_BINS, histogram_bins, strlen(histogram_bins)+1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user