aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-12-16 02:41:21 +0100
committerAlexander Færøy <ahf@torproject.org>2017-12-16 02:41:21 +0100
commitd4f4108601fe7e2614f30055ff5abe00460f6a12 (patch)
treef8c926dc04c1c476561fff41b6d7fb25eed3dd20 /src/or/config.c
parente44662a7f9af990753a89b0a831d3439a509c8ae (diff)
downloadtor-d4f4108601fe7e2614f30055ff5abe00460f6a12.tar.gz
tor-d4f4108601fe7e2614f30055ff5abe00460f6a12.zip
Add MainloopStats option.
This patch adds support for MainloopStats that allow developers to get main event loop statistics via Tor's heartbeat status messages. The new status log message will show how many succesful, erroneous, and idle event loop iterations we have had. See: https://bugs.torproject.org/24605
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index fa80dad576..3ae3af55a3 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -360,6 +360,7 @@ static config_var_t option_vars_[] = {
V(GuardLifetime, INTERVAL, "0 minutes"),
V(HardwareAccel, BOOL, "0"),
V(HeartbeatPeriod, INTERVAL, "6 hours"),
+ V(MainloopStats, BOOL, "0"),
V(AccelName, STRING, NULL),
V(AccelDir, FILENAME, NULL),
V(HashedControlPassword, LINELIST, NULL),
@@ -2157,6 +2158,10 @@ options_act(const or_options_t *old_options)
if (options->PerConnBWRate != old_options->PerConnBWRate ||
options->PerConnBWBurst != old_options->PerConnBWBurst)
connection_or_update_token_buckets(get_connection_array(), options);
+
+ if (options->MainloopStats != old_options->MainloopStats) {
+ reset_main_loop_counters();
+ }
}
/* Only collect directory-request statistics on relays and bridges. */