diff options
| author | luqiuwen <[email protected]> | 2019-08-13 19:50:51 +0800 |
|---|---|---|
| committer | luqiuwen <[email protected]> | 2019-08-13 19:50:51 +0800 |
| commit | 3015d4df862473c0c0cded1d4bff8e92ef5675b1 (patch) | |
| tree | 30dc6fd2c406bc7ebcdb31ccbd5b5ee0305244e3 /platform/src/proxy.cpp | |
| parent | 1e869c3ded631806106121b6964e728af0c6a1af (diff) | |
增加逐流的上、下游收发字节统计并对业务插件提供查询接口。
Diffstat (limited to 'platform/src/proxy.cpp')
| -rw-r--r-- | platform/src/proxy.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index 7f9b136..0406ed6 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -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 }; |
