diff --git a/CHANGES b/CHANGES
index 67331ad73c..b922bb3bba 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4795. [func] A new statistics counter has been added to track
+ priming queries. [RT #46313]
+
4794. [func] "dnssec-checkds -s" specifies a file from which
to read a DS set rather than querying the parent.
[RT #44667]
diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c
index b9370f875a..cc8cde80aa 100644
--- a/bin/named/statschannel.c
+++ b/bin/named/statschannel.c
@@ -395,6 +395,7 @@ init_desc(void) {
SET_RESSTATDESC(serverquota, "spilled due to server quota",
"ServerQuota");
SET_RESSTATDESC(nextitem, "waited for next item", "NextItem");
+ SET_RESSTATDESC(priming, "priming queries", "Priming");
INSIST(i == dns_resstatscounter_max);
@@ -1615,7 +1616,7 @@ generatexml(named_server_t *server, isc_uint32_t flags,
ISC_XMLCHAR "type=\"text/xsl\" href=\"/bind9.xsl\""));
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "statistics"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "version",
- ISC_XMLCHAR "3.10"));
+ ISC_XMLCHAR "3.11"));
/* Set common fields for statistics dump */
dumparg.type = isc_statsformat_xml;
@@ -2411,7 +2412,7 @@ generatejson(named_server_t *server, size_t *msglen,
/*
* These statistics are included no matter which URL we use.
*/
- obj = json_object_new_string("1.4");
+ obj = json_object_new_string("1.5");
CHECKMEM(obj);
json_object_object_add(bindstats, "json-stats-version", obj);
diff --git a/bin/tests/system/statistics/tests.sh b/bin/tests/system/statistics/tests.sh
index c049c989cc..a456882aee 100644
--- a/bin/tests/system/statistics/tests.sh
+++ b/bin/tests/system/statistics/tests.sh
@@ -137,5 +137,12 @@ fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+ret=0
+n=`expr $n + 1`
+echo "I:checking priming queries are counted ($n)"
+grep "1 priming queries" ns3/named.stats
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
diff --git a/doc/arm/notes.xml b/doc/arm/notes.xml
index d88018ae4a..fe52b2d672 100644
--- a/doc/arm/notes.xml
+++ b/doc/arm/notes.xml
@@ -683,6 +683,12 @@
queries. [RT #45847]
+
+
+ A new statistics counter has been added to track priming
+ queries. [RT #46313]
+
+
The dnssec-signzone -x flag and the
diff --git a/lib/dns/include/dns/stats.h b/lib/dns/include/dns/stats.h
index bcfa906e18..f4b061dc76 100644
--- a/lib/dns/include/dns/stats.h
+++ b/lib/dns/include/dns/stats.h
@@ -64,7 +64,8 @@ enum {
dns_resstatscounter_zonequota = 41,
dns_resstatscounter_serverquota = 42,
dns_resstatscounter_nextitem = 43,
- dns_resstatscounter_max = 44,
+ dns_resstatscounter_priming = 44,
+ dns_resstatscounter_max = 45,
/*
* DNSSEC stats.
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
index a153817974..cf71b054a4 100644
--- a/lib/dns/resolver.c
+++ b/lib/dns/resolver.c
@@ -9987,6 +9987,7 @@ dns_resolver_prime(dns_resolver_t *res) {
res->priming = ISC_FALSE;
UNLOCK(&res->lock);
}
+ inc_stats(res, dns_resstatscounter_priming);
}
}