From 423910e01bce71d58ad909fd92a45ac4eccb54e5 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 6 May 2021 09:46:02 -0400 Subject: dns: Gather DNS request statistics We now keep track of all errors and total number of request seen. This is so we can expose those values to the MetricsPort to help Exit operators monitor the DNS requests and failures. Related to #40367. Signed-off-by: David Goulet --- src/feature/stats/rephist.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/feature/stats/rephist.h') diff --git a/src/feature/stats/rephist.h b/src/feature/stats/rephist.h index b54fc77883..9d2e457b4b 100644 --- a/src/feature/stats/rephist.h +++ b/src/feature/stats/rephist.h @@ -80,6 +80,11 @@ void rep_hist_note_negotiated_link_proto(unsigned link_proto, int started_here); void rep_hist_log_link_protocol_counts(void); +uint64_t rep_hist_get_n_dns_error(int type, uint8_t error); +uint64_t rep_hist_get_n_dns_request(int type); +void rep_hist_note_dns_request(int type); +void rep_hist_note_dns_error(int type, uint8_t error); + extern uint64_t rephist_total_alloc; extern uint32_t rephist_total_num; #ifdef TOR_UNIT_TESTS -- cgit v1.2.3-54-g00ecf