aboutsummaryrefslogtreecommitdiff
path: root/src/feature/stats/rephist.h
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2021-03-17 18:23:18 +0200
committerGeorge Kadianakis <desnacked@riseup.net>2021-03-17 18:23:18 +0200
commit29f07a4e9d2e7cd061e696f673c42e00885ec231 (patch)
tree5db514a485f8b35a32fa1ed05a974e970fd37b7e /src/feature/stats/rephist.h
parent15a95df376f8b8e27072db8d36f28b7054d13cef (diff)
parent7740a8b5d4de649e3ba2a0578f789140725974b6 (diff)
downloadtor-29f07a4e9d2e7cd061e696f673c42e00885ec231.tar.gz
tor-29f07a4e9d2e7cd061e696f673c42e00885ec231.zip
Merge branch 'mr/334'
Diffstat (limited to 'src/feature/stats/rephist.h')
-rw-r--r--src/feature/stats/rephist.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/feature/stats/rephist.h b/src/feature/stats/rephist.h
index 26fb207d6f..5aaf5c9255 100644
--- a/src/feature/stats/rephist.h
+++ b/src/feature/stats/rephist.h
@@ -140,6 +140,24 @@ void rep_hist_reset_padding_counts(void);
void rep_hist_prep_published_padding_counts(time_t now);
void rep_hist_padding_count_timers(uint64_t num_timers);
+/**
+ * Represents the various types of overload we keep track of and expose in our
+ * extra-info descriptor.
+*/
+typedef enum {
+ /* A general overload -- can have many different causes. */
+ OVERLOAD_GENERAL,
+ /* We went over our configured read rate/burst bandwidth limit */
+ OVERLOAD_READ,
+ /* We went over our configured write rate/burst bandwidth limit */
+ OVERLOAD_WRITE,
+ /* We exhausted the file descriptors in this system */
+ OVERLOAD_FD_EXHAUSTED,
+} overload_type_t;
+
+void rep_hist_note_overload(overload_type_t overload);
+char *rep_hist_get_overload_stats_lines(void);
+
#ifdef TOR_UNIT_TESTS
struct hs_v2_stats_t;
const struct hs_v2_stats_t *rep_hist_get_hs_v2_stats(void);