Commit b6b83db9 authored by Grigorii Demidov's avatar Grigorii Demidov Committed by Petr Špaček

daemon/worker: separate counter for TLS sendings

parent 59f3b197
Pipeline #35574 passed with stages
in 8 minutes and 25 seconds
......@@ -1598,6 +1598,8 @@ static int wrk_stats(lua_State *L)
lua_setfield(L, -2, "udp");
lua_pushnumber(L, worker->stats.tcp);
lua_setfield(L, -2, "tcp");
lua_pushnumber(L, worker->stats.tls);
lua_setfield(L, -2, "tls");
lua_pushnumber(L, worker->stats.ipv6);
lua_setfield(L, -2, "ipv6");
lua_pushnumber(L, worker->stats.ipv4);
......
......@@ -946,6 +946,16 @@ ssize_t worker_gnutls_push(gnutls_transport_ptr_t h, const void *buf, size_t len
if (res == 0) {
if (task) {
qr_task_ref(task); /* Pending ioreq on current task */
struct request_ctx *ctx = task->ctx;
if (ctx && ctx->source.session &&
t->session->handle != ctx->source.session->handle) {
struct sockaddr *addr = &t->session->peer.ip;
worker->stats.tls += 1;
if (addr->sa_family == AF_INET6)
worker->stats.ipv6 += 1;
else if (addr->sa_family == AF_INET)
worker->stats.ipv4 += 1;
}
}
if (worker->too_many_open &&
worker->stats.rconcurrent <
......@@ -953,12 +963,6 @@ ssize_t worker_gnutls_push(gnutls_transport_ptr_t h, const void *buf, size_t len
worker->too_many_open = false;
}
ret = len;
struct sockaddr *addr = &t->session->peer.ip;
worker->stats.tcp += 1;
if (addr->sa_family == AF_INET6)
worker->stats.ipv6 += 1;
else if (addr->sa_family == AF_INET)
worker->stats.ipv4 += 1;
} else {
VERBOSE_MSG(NULL,"[%s] uv_write: %s\n",
t->client_side ? "tls_client" : "tls", uv_strerror(res));
......
......@@ -138,6 +138,7 @@ struct worker_ctx {
size_t rconcurrent;
size_t udp;
size_t tcp;
size_t tls;
size_t ipv4;
size_t ipv6;
size_t queries;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment