From: Ralph Dolmans Date: Fri, 8 May 2020 10:14:17 +0000 (+0200) Subject: - Add query.num.https counter X-Git-Tag: release-1.12.0rc1~22^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=723980fe77e327780d1bc80256ab3cf25f4d47db;p=thirdparty%2Funbound.git - Add query.num.https counter --- diff --git a/daemon/remote.c b/daemon/remote.c index 83eef7af2..09f3ae88f 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -979,6 +979,8 @@ print_ext(RES* ssl, struct ub_stats_info* s) (unsigned long)s->svr.qtls_resume)) return 0; if(!ssl_printf(ssl, "num.query.ipv6"SQ"%lu\n", (unsigned long)s->svr.qipv6)) return 0; + if(!ssl_printf(ssl, "num.query.https"SQ"%lu\n", + (unsigned long)s->svr.qhttps)) return 0; /* flags */ if(!ssl_printf(ssl, "num.query.flags.QR"SQ"%lu\n", (unsigned long)s->svr.qbit_QR)) return 0; diff --git a/daemon/stats.c b/daemon/stats.c index a568ba070..2b88eb097 100644 --- a/daemon/stats.c +++ b/daemon/stats.c @@ -421,6 +421,7 @@ void server_stats_add(struct ub_stats_info* total, struct ub_stats_info* a) total->svr.qtcp_outgoing += a->svr.qtcp_outgoing; total->svr.qtls += a->svr.qtls; total->svr.qtls_resume += a->svr.qtls_resume; + total->svr.qhttps += a->svr.qhttps; total->svr.qipv6 += a->svr.qipv6; total->svr.qbit_QR += a->svr.qbit_QR; total->svr.qbit_AA += a->svr.qbit_AA; @@ -484,6 +485,8 @@ void server_stats_insquery(struct ub_server_stats* stats, struct comm_point* c, if(SSL_session_reused(c->ssl)) stats->qtls_resume++; #endif + if(c->type == comm_http) + stats->qhttps++; } } if(repinfo && addr_is_ip6(&repinfo->addr, repinfo->addrlen)) diff --git a/doc/unbound-control.8.in b/doc/unbound-control.8.in index 74d06cfd9..42eb8ea14 100644 --- a/doc/unbound-control.8.in +++ b/doc/unbound-control.8.in @@ -545,6 +545,11 @@ These are also counted in num.query.tcp, because TLS uses TCP. Number of TLS session resumptions, these are queries over TLS towards the unbound server where the client negotiated a TLS session resumption key. .TP +.I num.query.https +Number of queries that were made using HTTPS towards the unbound server. +These are also counted in num.query.tcp and num.query.tls, because HTTPS +uses TLS and TCP. +.TP .I num.query.ipv6 Number of queries that were made using IPv6 towards the unbound server. .TP diff --git a/libunbound/unbound.h b/libunbound/unbound.h index ca9592d62..2fad02f2c 100644 --- a/libunbound/unbound.h +++ b/libunbound/unbound.h @@ -696,6 +696,8 @@ struct ub_server_stats { long long qtcp_outgoing; /** number of queries over (DNS over) TLS */ long long qtls; + /** number of queries over (DNS over) HTTPS */ + long long qhttps; /** number of queries over IPv6 */ long long qipv6; /** number of queries with QR bit */ diff --git a/smallapp/unbound-control.c b/smallapp/unbound-control.c index 4e5ce1e4b..ee5e44d2f 100644 --- a/smallapp/unbound-control.c +++ b/smallapp/unbound-control.c @@ -338,6 +338,7 @@ static void print_extended(struct ub_stats_info* s) PR_UL("num.query.tcpout", s->svr.qtcp_outgoing); PR_UL("num.query.tls", s->svr.qtls); PR_UL("num.query.tls_resume", s->svr.qtls_resume); + PR_UL("num.query.https", s->svr.qhttps); PR_UL("num.query.ipv6", s->svr.qipv6); /* flags */