aboutsummaryrefslogtreecommitdiff
path: root/src/feature/stats/rephist.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-05-06 09:46:02 -0400
committerDavid Goulet <dgoulet@torproject.org>2021-05-12 11:58:25 -0400
commit423910e01bce71d58ad909fd92a45ac4eccb54e5 (patch)
treef4c6ab8aa8dbd363d2c5c0f6209491029c1ac339 /src/feature/stats/rephist.h
parent897344fddc1ea5ba6dc0db814a703932b05560f4 (diff)
downloadtor-423910e01bce71d58ad909fd92a45ac4eccb54e5.tar.gz
tor-423910e01bce71d58ad909fd92a45ac4eccb54e5.zip
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 <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/stats/rephist.h')
-rw-r--r--src/feature/stats/rephist.h5
1 files changed, 5 insertions, 0 deletions
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