增加逐流的上、下游收发字节统计并对业务插件提供查询接口。

This commit is contained in:
luqiuwen
2019-08-13 19:50:51 +08:00
parent 1e869c3ded
commit 3015d4df86
6 changed files with 107 additions and 14 deletions

View File

@@ -234,7 +234,7 @@ void tfe_proxy_work_thread_create_ctx(struct tfe_proxy * proxy)
{
proxy->work_threads[i] = ALLOC(struct tfe_thread_ctx, 1);
proxy->work_threads[i]->thread_id = i;
proxy->work_threads[i]->evbase = event_base_new();
proxy->work_threads[i]->evbase = event_base_new();
proxy->work_threads[i]->dnsbase = evdns_base_new(proxy->work_threads[i]->evbase, EVDNS_BASE_INITIALIZE_NAMESERVERS);
}
return;
@@ -290,7 +290,7 @@ int tfe_proxy_config(struct tfe_proxy * proxy, const char * profile)
MESA_load_profile_int_def(profile, "tcp", "tcp_user_timeout", &proxy->tcp_options.tcp_user_timeout, -1);
MESA_load_profile_int_def(profile, "tcp", "tcp_ttl_upstream", &proxy->tcp_options.tcp_ttl_upstream, -1);
MESA_load_profile_int_def(profile, "tcp", "tcp_ttl_downstream", &proxy->tcp_options.tcp_ttl_downstream, -1);
return 0;
}
@@ -311,6 +311,8 @@ static const char * __str_stat_spec_map[] =
[STAT_STREAM_CLS_KILL] = "stm_kill",
[STAT_STREAM_TCP_PLAIN] = "plain",
[STAT_STREAM_TCP_SSL] = "SSL",
[STAT_STREAM_DOWN_RX_BYTES] = "dstm_bytes",
[STAT_STREAM_UP_RX_BYTES] = "ustm_bytes",
[TFE_STAT_MAX] = NULL
};