From 04648d7c2f2814623557d6659eff8a547cb32c3a Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Mon, 29 May 2023 15:19:49 +0000 Subject: [PATCH] Add ClientQuota statistics channel counter This counter indicates the number of the resolver's spilled queries due to reaching the clients per query quota. --- bin/named/statschannel.c | 2 ++ lib/dns/include/dns/stats.h | 7 ++++--- lib/dns/resolver.c | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c index ce324f991d..bbb402262e 100644 --- a/bin/named/statschannel.c +++ b/bin/named/statschannel.c @@ -464,6 +464,8 @@ init_desc(void) { SET_RESSTATDESC(zonequota, "spilled due to zone quota", "ZoneQuota"); SET_RESSTATDESC(serverquota, "spilled due to server quota", "ServerQuota"); + SET_RESSTATDESC(clientquota, "spilled due to clients per query quota", + "ClientQuota"); SET_RESSTATDESC(nextitem, "waited for next item", "NextItem"); SET_RESSTATDESC(priming, "priming queries", "Priming"); diff --git a/lib/dns/include/dns/stats.h b/lib/dns/include/dns/stats.h index 7b1b03e3a3..7a9f7143e2 100644 --- a/lib/dns/include/dns/stats.h +++ b/lib/dns/include/dns/stats.h @@ -71,9 +71,10 @@ enum { dns_resstatscounter_badcookie = 40, dns_resstatscounter_zonequota = 41, dns_resstatscounter_serverquota = 42, - dns_resstatscounter_nextitem = 43, - dns_resstatscounter_priming = 44, - dns_resstatscounter_max = 45, + dns_resstatscounter_clientquota = 43, + dns_resstatscounter_nextitem = 44, + dns_resstatscounter_priming = 45, + dns_resstatscounter_max = 46, /* * DNSSEC stats. diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 3295b55a9a..ce0d7bc389 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -10399,6 +10399,7 @@ dns_resolver_createfetch(dns_resolver_t *res, const dns_name_t *name, fctx->spilled = true; } if (fctx->spilled) { + inc_stats(res, dns_resstatscounter_clientquota); result = DNS_R_DROP; goto unlock; }