diff options
author | Alexander Færøy <ahf@torproject.org> | 2017-12-16 02:41:21 +0100 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2017-12-16 02:41:21 +0100 |
commit | d4f4108601fe7e2614f30055ff5abe00460f6a12 (patch) | |
tree | f8c926dc04c1c476561fff41b6d7fb25eed3dd20 /src/or/config.c | |
parent | e44662a7f9af990753a89b0a831d3439a509c8ae (diff) | |
download | tor-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.c | 5 |
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. */ |