diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2010-08-02 15:06:14 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2010-12-03 16:47:51 +0100 |
commit | 5dfdf075ac0cb3df66443011d3faa2c95dc53629 (patch) | |
tree | 7bd0ca2f3b876499a6310740ef838bf74afaeced /src/or/config.c | |
parent | 520182579a4c186e94a1ada1d66c09c89ee3f3c4 (diff) | |
download | tor-5dfdf075ac0cb3df66443011d3faa2c95dc53629.tar.gz tor-5dfdf075ac0cb3df66443011d3faa2c95dc53629.zip |
Add metric on uni/bidirectional connection usage.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c index d371276b18..5ab4b46d5f 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -200,6 +200,7 @@ static config_var_t _option_vars[] = { V(ClientOnly, BOOL, "0"), V(ConsensusParams, STRING, NULL), V(ConnLimit, UINT, "1000"), + V(ConnStatistics, BOOL, "0"), V(ConstrainedSockets, BOOL, "0"), V(ConstrainedSockSize, MEMUNIT, "8192"), V(ContactInfo, STRING, NULL), @@ -1391,7 +1392,8 @@ options_act(or_options_t *old_options) } if (options->CellStatistics || options->DirReqStatistics || - options->EntryStatistics || options->ExitPortStatistics) { + options->EntryStatistics || options->ExitPortStatistics || + options->ConnStatistics) { time_t now = time(NULL); if ((!old_options || !old_options->CellStatistics) && options->CellStatistics) @@ -1405,6 +1407,9 @@ options_act(or_options_t *old_options) if ((!old_options || !old_options->ExitPortStatistics) && options->ExitPortStatistics) rep_hist_exit_stats_init(now); + if ((!old_options || !old_options->ConnStatistics) && + options->ConnStatistics) + rep_hist_conn_stats_init(now); if (!old_options) log_notice(LD_CONFIG, "Configured to measure statistics. Look for " "the *-stats files that will first be written to the " @@ -1423,6 +1428,9 @@ options_act(or_options_t *old_options) if (old_options && old_options->ExitPortStatistics && !options->ExitPortStatistics) rep_hist_exit_stats_term(); + if (old_options && old_options->ConnStatistics && + !options->ConnStatistics) + rep_hist_conn_stats_term(); /* Check if we need to parse and add the EntryNodes config option. */ if (options->EntryNodes && |