aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2011-10-07 02:39:48 +0200
committerNick Mathewson <nickm@torproject.org>2011-10-21 11:21:42 -0400
commit03c06b629fc604030393567ec05c16f813d43529 (patch)
treea53474e347e5fa26ae5d14d2822be1869aaceeb3 /src/or/config.c
parentaf02c4a9c3ee0ab85a4ecf5c7ff16e2da901c886 (diff)
downloadtor-03c06b629fc604030393567ec05c16f813d43529.tar
tor-03c06b629fc604030393567ec05c16f813d43529.tar.gz
Add new stats type: descriptor fetch stats
This is used for the bridge authority currently, to get a better intuition on how many descriptors are actually fetched from it and how many fetches happen in total. Implements ticket 4200.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 59bbe1dd6..627e1ac5d 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1532,7 +1532,8 @@ options_act(const or_options_t *old_options)
if (options->CellStatistics || options->DirReqStatistics ||
options->EntryStatistics || options->ExitPortStatistics ||
- options->ConnDirectionStatistics) {
+ options->ConnDirectionStatistics ||
+ options->BridgeAuthoritativeDir) {
time_t now = time(NULL);
int print_notice = 0;
if ((!old_options || !old_options->CellStatistics) &&
@@ -1577,6 +1578,10 @@ options_act(const or_options_t *old_options)
options->ConnDirectionStatistics) {
rep_hist_conn_stats_init(now);
}
+ if (!old_options || !old_options->BridgeAuthoritativeDir) {
+ rep_hist_desc_stats_init(now);
+ print_notice = 1;
+ }
if (print_notice)
log_notice(LD_CONFIG, "Configured to measure statistics. Look for "
"the *-stats files that will first be written to the "
@@ -1598,6 +1603,9 @@ options_act(const or_options_t *old_options)
if (old_options && old_options->ConnDirectionStatistics &&
!options->ConnDirectionStatistics)
rep_hist_conn_stats_term();
+ if (old_options && old_options->BridgeAuthoritativeDir &&
+ !options->BridgeAuthoritativeDir)
+ rep_hist_desc_stats_term();
/* Check if we need to parse and add the EntryNodes config option. */
if (options->EntryNodes &&