summaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-09-29 14:40:34 +0000
committerNick Mathewson <nickm@torproject.org>2008-09-29 14:40:34 +0000
commit57db1c1a7dd4a1fd85fa462951737880189e5965 (patch)
treec6958b140d894f67a2addbc278f653622a2e1967 /src/or/rephist.c
parentee0078ead4d41dc87c080ab5d9ec955770aca3de (diff)
downloadtor-57db1c1a7dd4a1fd85fa462951737880189e5965.tar.gz
tor-57db1c1a7dd4a1fd85fa462951737880189e5965.zip
Tweak the dbg-stability.txt code to log everything else that influences router stability calculations.
svn:r17003
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 8019be7257..fbe8f168e1 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -837,17 +837,34 @@ rep_hist_get_router_stability_doc(time_t now)
tor_free(last_stability_doc);
chunks = smartlist_create();
+ if (rep_hist_have_measured_enough_stability()) {
+ smartlist_add(chunks, tor_strdup("we-have-enough-measurements\n"));
+ } else {
+ smartlist_add(chunks, tor_strdup("we-do-not-have-enough-measurements\n"));
+ }
+
DIGESTMAP_FOREACH(history_map, id, or_history_t *, hist) {
routerinfo_t *ri;
char dbuf[BASE64_DIGEST_LEN+1];
- char header_buf[128];
+ char header_buf[512];
char *info;
digest_to_base64(dbuf, id);
ri = router_get_by_digest(id);
if (ri) {
char *ip = tor_dup_ip(ri->addr);
- tor_snprintf(header_buf, sizeof(header_buf), "router %s %s %s\n",
- dbuf, ri->nickname, ip);
+ char tbuf[ISO_TIME_LEN+1];
+ format_iso_time(tbuf, ri->cache_info.published_on);
+ tor_snprintf(header_buf, sizeof(header_buf),
+ "router %s %s %s\n"
+ "published %s\n"
+ "relevant-flags%s%s%s\n"
+ "declared-uptime %ld\n",
+ dbuf, ri->nickname, ip,
+ tbuf,
+ ri->is_running ? "Running " : "",
+ ri->is_valid ? "Valid " : "",
+ ri->is_hibernating ? "Hibernating " : "",
+ ri->uptime);
tor_free(ip);
} else {
tor_snprintf(header_buf, sizeof(header_buf),
@@ -857,6 +874,7 @@ rep_hist_get_router_stability_doc(time_t now)
info = rep_hist_format_router_status(hist, now);
if (info)
smartlist_add(chunks, info);
+
} DIGESTMAP_FOREACH_END;
result = smartlist_join_strings(chunks, "", 0, NULL);