]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- unbound-control stats prints num.query.tcpout with number of TCP
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 10 Apr 2014 09:13:58 +0000 (09:13 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 10 Apr 2014 09:13:58 +0000 (09:13 +0000)
  outgoing queries made in the previous statistics interval.

git-svn-id: file:///svn/unbound/trunk@3108 be551aaa-1e26-0410-a405-d3ace91eadb9

contrib/unbound_munin_
daemon/remote.c
daemon/stats.c
daemon/stats.h
daemon/worker.c
doc/Changelog
doc/unbound-control.8.in
services/outside_network.c
services/outside_network.h

index 5c047323cae273ea0c41597623ca3082049f9446..6ca4902b9cf16b749e64b362ed27cba0d1266101 100755 (executable)
@@ -238,6 +238,7 @@ if test "$1" = "config" ; then
                p_config "total.num.cachehits" "cache hits"
                p_config "total.num.prefetch" "cache prefetch"
                p_config "num.query.tcp" "TCP queries"
+               p_config "num.query.tcpout" "TCP out queries"
                p_config "num.query.ipv6" "IPv6 queries"
                p_config "unwanted.queries" "queries that failed acl"
                p_config "unwanted.replies" "unwanted or unsolicited replies"
@@ -425,7 +426,8 @@ hits)
        for x in `grep "^thread[0-9][0-9]*\.num\.queries=" $state |
                sed -e 's/=.*//'` total.num.queries \
                total.num.cachehits total.num.prefetch num.query.tcp \
-               num.query.ipv6 unwanted.queries unwanted.replies; do
+               num.query.tcpout num.query.ipv6 unwanted.queries \
+               unwanted.replies; do
                if grep "^"$x"=" $state >/dev/null 2>&1; then
                        print_qps $x
                fi
index 9ff40325fd315de395dafeba54ac8450eb66c8d4..93f1862a52330eb0e9190a3707aa6835274bb9a4 100644 (file)
@@ -821,6 +821,8 @@ print_ext(SSL* ssl, struct stats_info* s)
        /* transport */
        if(!ssl_printf(ssl, "num.query.tcp"SQ"%u\n", 
                (unsigned)s->svr.qtcp)) return 0;
+       if(!ssl_printf(ssl, "num.query.tcpout"SQ"%u\n", 
+               (unsigned)s->svr.qtcp_outgoing)) return 0;
        if(!ssl_printf(ssl, "num.query.ipv6"SQ"%u\n", 
                (unsigned)s->svr.qipv6)) return 0;
        /* flags */
index 57ad1ef6bcdd74ec1049c3c4540ae9962eb63622..6abbfefca7fdf9e6cb83f353e791fbaffc92747e 100644 (file)
@@ -158,6 +158,7 @@ server_stats_compile(struct worker* worker, struct stats_info* s, int reset)
                NUM_BUCKETS_HIST);
        /* values from outside network */
        s->svr.unwanted_replies = worker->back->unwanted_replies;
+       s->svr.qtcp_outgoing = worker->back->num_tcp_outgoing;
 
        /* get and reset validator rrset bogus number */
        s->svr.rrset_bogus = get_rrset_bogus(worker);
@@ -217,6 +218,7 @@ void server_stats_add(struct stats_info* total, struct stats_info* a)
                total->svr.qtype_big += a->svr.qtype_big;
                total->svr.qclass_big += a->svr.qclass_big;
                total->svr.qtcp += a->svr.qtcp;
+               total->svr.qtcp_outgoing += a->svr.qtcp_outgoing;
                total->svr.qipv6 += a->svr.qipv6;
                total->svr.qbit_QR += a->svr.qbit_QR;
                total->svr.qbit_AA += a->svr.qbit_AA;
index 7c315513f369066e0727b4a7215cab0d7531d09c..92487b8b6273ff5f99e24a0ee00a385f60703add 100644 (file)
@@ -91,6 +91,8 @@ struct server_stats {
        size_t qopcode[STATS_OPCODE_NUM];
        /** number of queries over TCP */
        size_t qtcp;
+       /** number of outgoing queries over TCP */
+       size_t qtcp_outgoing;
        /** number of queries over IPv6 */
        size_t qipv6;
        /** number of queries with QR bit */
index 67cd427b69fdf7b7eda080e0ead0b6bd09846a3b..89929d4fb07940b69ff9210d762327dd07919306 100644 (file)
@@ -1324,6 +1324,7 @@ void worker_stats_clear(struct worker* worker)
        server_stats_init(&worker->stats, worker->env.cfg);
        mesh_stats_clear(worker->env.mesh);
        worker->back->unwanted_replies = 0;
+       worker->back->num_tcp_outgoing = 0;
 }
 
 void worker_start_accept(void* arg)
index 8fda4c683479bb147bda6e741c77601b21dc89ad..a8e99a0770c33a588d642a73bfe991c28d7ab50e 100644 (file)
@@ -2,6 +2,9 @@
        - iana portlist updated.
        - Patch from Hannes Frederic Sowa for Linux 3.15 fragmentation
          option for DNS fragmentation defense.
+       - Document that dump_requestlist only prints queries from thread 0.
+       - unbound-control stats prints num.query.tcpout with number of TCP
+         outgoing queries made in the previous statistics interval.
 
 8 April 2014: Wouter
        - Fix #574: make test fails on Ubuntu 14.04.  Disabled remote-control
index 3a9abfc22cc45d3432f63e436b3bc7c3a39083e2..a40895cb510c20793e6c167d305f5a92208a3140 100644 (file)
@@ -147,6 +147,8 @@ such as a higher verbosity level.
 Show what is worked on.  Prints all queries that the server is currently
 working on.  Prints the time that users have been waiting.  For internal
 requests, no time is printed.  And then prints out the module status.
+This prints the queries from the first thread, and not queries that are
+being serviced from other threads.
 .TP
 .B flush_infra \fIall|IP
 If all then entire infra cache is emptied.  If a specific IP address, the
@@ -401,6 +403,10 @@ Also printed for other opcodes, UPDATE, ...
 .I num.query.tcp
 Number of queries that were made using TCP towards the unbound server.
 .TP
+.I num.query.tcpout
+Number of queries that the unbound server made using TCP outgoing towards
+other servers.
+.TP
 .I num.query.ipv6
 Number of queries that were made using IPv6 towards the unbound server.
 .TP
index fedbd0fa8c8e3a34d7e2190d0b948bfb741fb6dc..3b685804f0de5ca9bebe6252ed1e0a51a3eb3583 100644 (file)
@@ -258,6 +258,7 @@ outnet_tcp_take_into_use(struct waiting_tcp* w, uint8_t* pkt, size_t pkt_len)
        w->pkt = NULL;
        w->next_waiting = (void*)pend;
        pend->id = LDNS_ID_WIRE(pkt);
+       w->outnet->num_tcp_outgoing++;
        w->outnet->tcp_free = pend->next_free;
        pend->next_free = NULL;
        pend->query = w;
@@ -600,6 +601,7 @@ outside_network_create(struct comm_base *base, size_t bufsize,
        comm_base_timept(base, &outnet->now_secs, &outnet->now_tv);
        outnet->base = base;
        outnet->num_tcp = num_tcp;
+       outnet->num_tcp_outgoing = 0;
        outnet->infra = infra;
        outnet->rnd = rnd;
        outnet->sslctx = sslctx;
index dda9d6f5a235d503c0aab696bc606a0100de1689..a56a205c3ba64281d88a7e4f0764326eff220d4e 100644 (file)
@@ -135,6 +135,8 @@ struct outside_network {
        struct pending_tcp **tcp_conns;
        /** number of tcp communication points. */
        size_t num_tcp;
+       /** number of tcp communication points in use. */
+       size_t num_tcp_outgoing;
        /** list of tcp comm points that are free for use */
        struct pending_tcp* tcp_free;
        /** list of tcp queries waiting for a buffer */