增加连接层的性能统计

This commit is contained in:
Lu Qiuwen
2018-11-02 13:52:30 +08:00
parent 2e13728bfc
commit b3b65369d8
6 changed files with 152 additions and 92 deletions

View File

@@ -251,6 +251,7 @@ void __kni_event_cb(evutil_socket_t fd, short what, void * user)
__accept_para.downstream_fd = __fds[0];
__accept_para.upstream_fd = __fds[1];
TFE_PROXY_STAT_INCREASE(STAT_FD_OPEN_BY_KNI_ACCEPT, 2);
if (tfe_proxy_fds_accept(__ctx->proxy, &__accept_para) < 0)
{
goto __drop_recieved_fds;
@@ -262,6 +263,7 @@ __close_kni_connection:
__kni_conn_close(__ctx);
__drop_recieved_fds:
TFE_PROXY_STAT_INCREASE(STAT_FD_CLOSE_BY_KNI_ACCEPT_FAIL, 2);
evutil_closesocket(__fds[0]);
evutil_closesocket(__fds[1]);
}