]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Add query.num.https counter
authorRalph Dolmans <ralph@nlnetlabs.nl>
Fri, 8 May 2020 10:14:17 +0000 (12:14 +0200)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Fri, 8 May 2020 10:14:17 +0000 (12:14 +0200)
daemon/remote.c
daemon/stats.c
doc/unbound-control.8.in
libunbound/unbound.h
smallapp/unbound-control.c

index 83eef7af2bc96be8179880aa58a1b9bd76cc0615..09f3ae88fc6259a85e781f68ae1118b5b7b66274 100644 (file)
@@ -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;
index a568ba070a57313a4b022a8d3480f1ace27c81d7..2b88eb0976b2ee054e06152210aa6401520634f7 100644 (file)
@@ -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))
index 74d06cfd9ea038e49ad85b5de74dbba050bb1cd6..42eb8ea140e5801c47c76cc36371d2945d334c55 100644 (file)
@@ -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
index ca9592d62d52685b0dd99d395d3e57126db2418b..2fad02f2c4b68460c76ad9a02b04cad8c0e89ebd 100644 (file)
@@ -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 */
index 4e5ce1e4baf779a1685157310abd0f0581009b3f..ee5e44d2fff418f74e7152d1f73f0c489f13c64e 100644 (file)
@@ -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 */