增加HTTP业务层和缓存运行状态统计。业务层状态输出到tfe.fieldstat,缓存输出到cache.fieldstat。增加缓存开关。

This commit is contained in:
zhengchao
2018-10-17 20:21:21 +08:00
parent 00a0ec675a
commit 71109517b4
9 changed files with 482 additions and 125 deletions

View File

@@ -21,7 +21,6 @@ struct json_spec
const char *log_filed_name;
enum tfe_http_std_field field_id;
};
struct pangu_logger
{
char local_ip_str[TFE_SYMBOL_MAX];
@@ -149,6 +148,7 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg)
cJSON *common_obj=NULL, *per_hit_obj=NULL;
char* log_payload=NULL;
int kafka_status=0;
int send_cnt=0;
time_t cur_time;
char src_ip_str[MAX(INET6_ADDRSTRLEN,INET_ADDRSTRLEN)] = {0};
char dst_ip_str[MAX(INET6_ADDRSTRLEN,INET_ADDRSTRLEN)] = {0};
@@ -235,8 +235,9 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg)
{
TFE_LOG_ERROR(handle->local_logger, "Kafka produce failed: %s", rd_kafka_err2name(rd_kafka_last_error()));
}
send_cnt++;
}
cJSON_free(common_obj);
return 0;
return send_cnt;
}