summaryrefslogtreecommitdiff
path: root/platform/src/proxy.cpp
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2020-06-18 14:08:05 +0800
committerluwenpeng <[email protected]>2020-06-18 14:14:10 +0800
commit7c23dca564e153725954d3d4750fe69c6b4b34ac (patch)
treec731f317fd9898ecedb6f73ed5288204e566454c /platform/src/proxy.cpp
parentcf42953af566ac7d1a2b1e60c4f4f9ed6c263023 (diff)
TSG-1806 tfe.conf/future.conf 均增加 statsd_format 配置项,用于调整 fieldstat 输出格式
Diffstat (limited to 'platform/src/proxy.cpp')
-rw-r--r--platform/src/proxy.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp
index 4b3eac5..9d11484 100644
--- a/platform/src/proxy.cpp
+++ b/platform/src/proxy.cpp
@@ -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);