diff options
author | Roger Dingledine <arma@torproject.org> | 2005-07-25 10:29:21 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-07-25 10:29:21 +0000 |
commit | 1e0fdcae988293a333686d9679d2defa6d2d2d26 (patch) | |
tree | 19e462909961ea547d55708d447bb193f3f2e688 | |
parent | 2fa109102ae491202e096f836f33ec85d82a6d90 (diff) | |
download | tor-1e0fdcae988293a333686d9679d2defa6d2d2d26.tar.gz tor-1e0fdcae988293a333686d9679d2defa6d2d2d26.zip |
parameterize RephistTrackTime
svn:r4673
-rw-r--r-- | src/or/config.c | 1 | ||||
-rw-r--r-- | src/or/main.c | 6 | ||||
-rw-r--r-- | src/or/or.h | 1 | ||||
-rw-r--r-- | src/or/rephist.c | 2 |
4 files changed, 7 insertions, 3 deletions
diff --git a/src/or/config.c b/src/or/config.c index 4606ac1663..43edabb687 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -163,6 +163,7 @@ static config_var_t _config_vars[] = { VAR("LongLivedPorts", CSV, LongLivedPorts, "21,22,706,1863,5050,5190,5222,5223,6667,8300,8888"), VAR("PathlenCoinWeight", DOUBLE, PathlenCoinWeight, "0.3"), VAR("RedirectExit", LINELIST, RedirectExit, NULL), + VAR("RephistTrackTime", INTERVAL, RephistTrackTime, "24 hours"), OBSOLETE("RouterFile"), VAR("RunAsDaemon", BOOL, RunAsDaemon, "0"), VAR("RunTesting", BOOL, RunTesting, "0"), diff --git a/src/or/main.c b/src/or/main.c index f85554e5c5..af891fb3c8 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -709,7 +709,7 @@ run_scheduled_events(time_t now) } /* Also, take this chance to remove old information from rephist. */ - rep_history_clean(now-24*60*60); + rep_history_clean(now - options->RephistTrackTime); } if (time_to_fetch_running_routers < now) { @@ -873,8 +873,10 @@ second_elapsed_callback(int fd, short event, void *args) current_second = now.tv_sec; /* remember which second it is, for next time */ #if 0 - if (current_second % 60 == 0) + if (current_second % 300 == 0) { + rep_history_clean(now - options->RephistTrackTime); dumpmemusage(get_min_log_level()<LOG_INFO ? get_min_log_level() : LOG_INFO); + } #endif if (evtimer_add(timeout_event, &one_second)) diff --git a/src/or/or.h b/src/or/or.h index 6992750dff..0c788904a0 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1173,6 +1173,7 @@ typedef struct { int UseHelperNodes; /**< Boolean: Do we try to enter from a smallish number * of fixed nodes? */ int NumHelperNodes; /**< How many helper nodes do we try to establish? */ + int RephistTrackTime; /**< How many seconds do we keep rephist info? */ } or_options_t; #define MAX_SOCKS_REPLY_LEN 1024 diff --git a/src/or/rephist.c b/src/or/rephist.c index ea8756a721..f208bf95f6 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -290,7 +290,7 @@ rep_hist_dump_stats(time_t now, int severity) unsigned long upt, downt; routerinfo_t *r; - rep_history_clean(now-24*60*60); + rep_history_clean(now - get_options()->RephistTrackTime); log(severity, "--------------- Dumping history information:"); |