summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2021-03-09 15:39:03 +0200
committerGeorge Kadianakis <desnacked@riseup.net>2021-03-17 18:22:38 +0200
commitf493a12e897b02f2e347078dc3e2a2437c324b66 (patch)
treee3e9ca242526b71090ad255d1dcd182b875e8f2d /src/core
parent0a5ecb334298187a64f58382231245111130aa76 (diff)
downloadtor-f493a12e897b02f2e347078dc3e2a2437c324b66.tar.gz
tor-f493a12e897b02f2e347078dc3e2a2437c324b66.zip
Implement straightforward overload general metrics.
- OOM metric - onionskin overload metric - DNS timeout metric
Diffstat (limited to 'src/core')
-rw-r--r--src/core/or/relay.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 32d6ca731a..d0de81dd7e 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -83,6 +83,7 @@
#include "feature/nodelist/routerlist.h"
#include "core/or/scheduler.h"
#include "feature/hs/hs_metrics.h"
+#include "feature/stats/rephist.h"
#include "core/or/cell_st.h"
#include "core/or/cell_queue_st.h"
@@ -2720,6 +2721,9 @@ cell_queues_check_size(void)
if (alloc >= get_options()->MaxMemInQueues_low_threshold) {
last_time_under_memory_pressure = approx_time();
if (alloc >= get_options()->MaxMemInQueues) {
+ /* Note this overload down */
+ rep_hist_note_overload(OVERLOAD_GENERAL);
+
/* If we're spending over 20% of the memory limit on hidden service
* descriptors, free them until we're down to 10%. Do the same for geoip
* client cache. */