diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2009-08-25 17:13:12 -0700 |
---|---|---|
committer | Mike Perry <mikeperry-git@fscked.org> | 2009-09-16 15:48:51 -0700 |
commit | 7750bee21dda817611afd936558834bb21411301 (patch) | |
tree | 69da7d45f0b5d42f220c35f284bf2aafdf18a096 /src/or/config.c | |
parent | 2dbf5b77417cf774f0bb783efd7856b53ab09077 (diff) | |
download | tor-7750bee21dda817611afd936558834bb21411301.tar tor-7750bee21dda817611afd936558834bb21411301.tar.gz |
Clean up Fallon's partially complete GSoC project.
The code actually isn't that bad. It's a shame she didn't finish.
Using it as the base for this feature.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index d830229d3..0345ca728 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -409,6 +409,11 @@ static config_var_t _state_vars[] = { V(LastRotatedOnionKey, ISOTIME, NULL), V(LastWritten, ISOTIME, NULL), + VAR("TotalBuildTimes", UINT, TotalBuildTimes, NULL), + VAR("CircuitBuildTimeBin", LINELIST_S, BuildtimeHistogram, NULL), + VAR("BuildtimeHistogram", LINELIST_V, BuildtimeHistogram, NULL), + + { NULL, CONFIG_TYPE_OBSOLETE, 0, NULL } }; @@ -597,6 +602,10 @@ static config_var_description_t options_description[] = { /* Hidden service options: HiddenService: dir,excludenodes, nodes, * options, port. PublishHidServDescriptor */ + /* Circuit build time histogram options */ + { "CircuitBuildTimeBin", "Histogram of recent circuit build times"}, + { "TotalBuildTimes", "Total number of buildtimes in histogram"}, + /* Nonpersistent options: __LeaveStreamsUnattached, __AllDirActionsPrivate */ { NULL, NULL }, }; @@ -5060,6 +5069,13 @@ or_state_set(or_state_t *new_state) log_warn(LD_GENERAL,"Unparseable bandwidth history state: %s",err); tor_free(err); } + + if(circuit_build_times_parse_state(global_state, &err) < 0) { + log_warn(LD_GENERAL,"%s",err); + tor_free(err); + + } + } /** Reload the persistent state from disk, generating a new state as needed. @@ -5192,6 +5208,7 @@ or_state_save(time_t now) * to avoid redundant writes. */ entry_guards_update_state(global_state); rep_hist_update_state(global_state); + circuit_build_times_update_state(global_state); if (accounting_is_enabled(get_options())) accounting_run_housekeeping(now); |