From: Aram Sargsyan Date: Thu, 15 Jan 2026 15:03:09 +0000 (+0000) Subject: Calculate incoming queries RTT statistics X-Git-Tag: v9.21.20~24^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=450a4189b31c55013d863aab5c32bea0a24d069f;p=thirdparty%2Fbind9.git Calculate incoming queries RTT statistics In client_senddone() update the RTT statistics for the incoming queries. --- diff --git a/lib/ns/client.c b/lib/ns/client.c index 3c42a85bf0d..c0a5649a3bc 100644 --- a/lib/ns/client.c +++ b/lib/ns/client.c @@ -325,7 +325,24 @@ client_senddone(isc_nmhandle_t *handle, isc_result_t result, void *cbarg) { */ client->inner.sendhandle = NULL; - if (result != ISC_R_SUCCESS) { + if (result == ISC_R_SUCCESS) { + isc_histomulti_t *hmpin = NULL; + + if (client->inner.view != NULL && + client->inner.view->resolver != NULL) + { + dns_resolver_getqueryrttstats( + client->inner.view->resolver, &hmpin, NULL); + } + if (hmpin != NULL) { + const unsigned int rtt = (unsigned int) + isc_time_microdiff(&client->inner.tnow, + &client->inner.requesttime); + const unsigned int rttms = rtt / US_PER_MS; + isc_histomulti_inc(hmpin, rttms); + isc_histomulti_detach(&hmpin); + } + } else { if (!TCP_CLIENT(client) && result == ISC_R_MAXSIZE) { ns_client_log(client, DNS_LOGCATEGORY_SECURITY, NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(3),