2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Record how often DNS_R_COVERINGNSEC is returned from the cache

reported as "covering nsec returned" when dumping cache stats
and as "CoveringNSEC" in json and xml cache statistics.
This commit is contained in:
Mark Andrews
2021-10-27 13:25:41 +11:00
committed by Petr Špaček
parent 90dbdb2cb5
commit 43316a40a0
3 changed files with 15 additions and 2 deletions

View File

@@ -1260,6 +1260,9 @@ dns_cache_dumpstats(dns_cache_t *cache, FILE *fp) {
fprintf(fp, "%20" PRIu64 " %s\n",
values[dns_cachestatscounter_deletettl],
"cache records deleted due to TTL expiration");
fprintf(fp, "%20" PRIu64 " %s\n",
values[dns_cachestatscounter_coveringnsec],
"covering nsec returned");
fprintf(fp, "%20u %s\n", dns_db_nodecount(cache->db, dns_dbtree_main),
"cache database nodes");
fprintf(fp, "%20u %s\n", dns_db_nodecount(cache->db, dns_dbtree_nsec),
@@ -1328,6 +1331,8 @@ dns_cache_renderxml(dns_cache_t *cache, void *writer0) {
writer));
TRY0(renderstat("DeleteTTL", values[dns_cachestatscounter_deletettl],
writer));
TRY0(renderstat("CoveringNSEC",
values[dns_cachestatscounter_coveringnsec], writer));
TRY0(renderstat("CacheNodes",
dns_db_nodecount(cache->db, dns_dbtree_main), writer));
@@ -1393,6 +1398,10 @@ dns_cache_renderjson(dns_cache_t *cache, void *cstats0) {
CHECKMEM(obj);
json_object_object_add(cstats, "DeleteTTL", obj);
obj = json_object_new_int64(values[dns_cachestatscounter_coveringnsec]);
CHECKMEM(obj);
json_object_object_add(cstats, "CoveringNSEC", obj);
obj = json_object_new_int64(
dns_db_nodecount(cache->db, dns_dbtree_main));
CHECKMEM(obj);