commit b810d322bfc55d202dbbd2e8ebe4529cf0778c8b Author: Mike Perry mikeperry-git@fscked.org Date: Sun Jan 20 14:30:02 2013 -0800
squash! Remove a source of error during path bias scaling
Improve debug logs and fix a state fencepost error. --- src/or/circuitbuild.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index a4c67cf..97a26dd 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2105,6 +2105,9 @@ pathbias_count_circs_in_states(entry_guard_t *guard, fast_memeq(guard->identity, ocirc->cpath->extend_info->identity_digest, DIGEST_LEN)) { + log_debug(LD_CIRC, "Found opened circuit %d in path_state %s", + ocirc->global_identifier, + pathbias_state_to_string(ocirc->path_state)); open_circuits++; } } @@ -2245,7 +2248,7 @@ pathbias_check_use_rate(entry_guard_t *guard) const int scale_factor = pathbias_get_scale_factor(options); const int mult_factor = pathbias_get_mult_factor(options); int opened_attempts = pathbias_count_circs_in_states(guard, - PATH_STATE_USE_ATTEMPTED, PATH_STATE_USE_ATTEMPTED); + PATH_STATE_USE_ATTEMPTED, PATH_STATE_USE_SUCCEEDED); guard->use_attempts -= opened_attempts;
guard->use_attempts *= mult_factor; @@ -2257,8 +2260,8 @@ pathbias_check_use_rate(entry_guard_t *guard) guard->use_attempts += opened_attempts;
log_info(LD_CIRC, - "Scaled pathbias use counts to %f/%f for guard %s=%s", - guard->use_successes, guard->use_attempts, + "Scaled pathbias use counts to %f/%f (%d open) for guard %s=%s", + guard->use_successes, guard->use_attempts, opened_attempts, guard->nickname, hex_str(guard->identity, DIGEST_LEN)); }
@@ -2416,10 +2419,11 @@ pathbias_check_close_rate(entry_guard_t *guard) guard->circ_successes += opened_built;
log_info(LD_CIRC, - "Scaled pathbias counts to (%f,%f)/%f for guard %s=%s", + "Scaled pathbias counts to (%f,%f)/%f (%d/%d open) for guard " + "%s=%s", guard->circ_successes, guard->successful_circuits_closed, - guard->circ_attempts, guard->nickname, - hex_str(guard->identity, DIGEST_LEN)); + guard->circ_attempts, opened_built, opened_attempts, + guard->nickname, hex_str(guard->identity, DIGEST_LEN)); }
return 0;
tor-commits@lists.torproject.org