aboutsummaryrefslogtreecommitdiff
path: root/src/feature/stats/rephist.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-10-20 10:40:56 -0400
committerDavid Goulet <dgoulet@torproject.org>2021-10-20 10:40:56 -0400
commite7abab878241592e262bad1bd64a14b10cc392a4 (patch)
tree3fe2c9cd6acefb719473ed5a0666223406d05e88 /src/feature/stats/rephist.c
parent7a8108ea87320da3008e65747baa43c1bbcf13c2 (diff)
downloadtor-e7abab878241592e262bad1bd64a14b10cc392a4.tar.gz
tor-e7abab878241592e262bad1bd64a14b10cc392a4.zip
relay: For metrics, don't report DNS errors by query type
This is due to the libevent bug https://github.com/libevent/libevent/issues/1219 that fails to return back the DNS record type on error. And so, the MetricsPort now only reports the errors as a global counter and not a per record type. Closes #40490 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/stats/rephist.c')
-rw-r--r--src/feature/stats/rephist.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/feature/stats/rephist.c b/src/feature/stats/rephist.c
index aef12e5628..b4431f5a76 100644
--- a/src/feature/stats/rephist.c
+++ b/src/feature/stats/rephist.c
@@ -296,12 +296,29 @@ typedef struct {
uint64_t stats_n_request;
} dns_stats_t;
+/* This is disabled because of the libevent bug where on error we don't get the
+ * DNS query type back. Once it is fixed, we can re-enable this. */
+#if 0
/** DNS statistics store for each DNS record type for which tor supports only
* three at the moment: A, PTR and AAAA. */
static dns_stats_t dns_A_stats;
static dns_stats_t dns_PTR_stats;
static dns_stats_t dns_AAAA_stats;
+#endif
+
+/** DNS query statistics store. It covers all type of queries. */
+static dns_stats_t dns_all_stats;
+
+/** Return the point to the DNS statistics store. Ignore the type for now
+ * because of a libevent problem. */
+static inline dns_stats_t *
+get_dns_stats_by_type(const int type)
+{
+ (void) type;
+ return &dns_all_stats;
+}
+#if 0
/** From a libevent record type, return a pointer to the corresponding DNS
* statistics store. NULL is returned if the type is unhandled. */
static inline dns_stats_t *
@@ -318,6 +335,7 @@ get_dns_stats_by_type(const int type)
return NULL;
}
}
+#endif
/** Assess the DNS timeout errors and if we have enough to trigger a general
* overload. */