mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-23 14:40:51 +01:00
Tweak the dbg-stability.txt code to log everything else that influences router stability calculations.
svn:r17003
This commit is contained in:
parent
ee0078ead4
commit
57db1c1a7d
2 changed files with 24 additions and 5 deletions
|
@ -1814,14 +1814,15 @@ dirserv_compute_performance_thresholds(routerlist_t *rl)
|
||||||
"Cutoffs: For Stable, %lu sec uptime, %lu sec MTBF. "
|
"Cutoffs: For Stable, %lu sec uptime, %lu sec MTBF. "
|
||||||
"For Fast: %lu bytes/sec. "
|
"For Fast: %lu bytes/sec. "
|
||||||
"For Guard: WFU %.03lf%%, time-known %lu sec, "
|
"For Guard: WFU %.03lf%%, time-known %lu sec, "
|
||||||
"and bandwidth %lu or %lu bytes/sec.",
|
"and bandwidth %lu or %lu bytes/sec. We do%s have enough stability data.",
|
||||||
(unsigned long)stable_uptime,
|
(unsigned long)stable_uptime,
|
||||||
(unsigned long)stable_mtbf,
|
(unsigned long)stable_mtbf,
|
||||||
(unsigned long)fast_bandwidth,
|
(unsigned long)fast_bandwidth,
|
||||||
guard_wfu*100,
|
guard_wfu*100,
|
||||||
(unsigned long)guard_tk,
|
(unsigned long)guard_tk,
|
||||||
(unsigned long)guard_bandwidth_including_exits,
|
(unsigned long)guard_bandwidth_including_exits,
|
||||||
(unsigned long)guard_bandwidth_excluding_exits);
|
(unsigned long)guard_bandwidth_excluding_exits,
|
||||||
|
enough_mtbf_info ? "" : "not ");
|
||||||
|
|
||||||
tor_free(uptimes);
|
tor_free(uptimes);
|
||||||
tor_free(mtbfs);
|
tor_free(mtbfs);
|
||||||
|
|
|
@ -837,17 +837,34 @@ rep_hist_get_router_stability_doc(time_t now)
|
||||||
tor_free(last_stability_doc);
|
tor_free(last_stability_doc);
|
||||||
chunks = smartlist_create();
|
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) {
|
DIGESTMAP_FOREACH(history_map, id, or_history_t *, hist) {
|
||||||
routerinfo_t *ri;
|
routerinfo_t *ri;
|
||||||
char dbuf[BASE64_DIGEST_LEN+1];
|
char dbuf[BASE64_DIGEST_LEN+1];
|
||||||
char header_buf[128];
|
char header_buf[512];
|
||||||
char *info;
|
char *info;
|
||||||
digest_to_base64(dbuf, id);
|
digest_to_base64(dbuf, id);
|
||||||
ri = router_get_by_digest(id);
|
ri = router_get_by_digest(id);
|
||||||
if (ri) {
|
if (ri) {
|
||||||
char *ip = tor_dup_ip(ri->addr);
|
char *ip = tor_dup_ip(ri->addr);
|
||||||
tor_snprintf(header_buf, sizeof(header_buf), "router %s %s %s\n",
|
char tbuf[ISO_TIME_LEN+1];
|
||||||
dbuf, ri->nickname, ip);
|
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);
|
tor_free(ip);
|
||||||
} else {
|
} else {
|
||||||
tor_snprintf(header_buf, sizeof(header_buf),
|
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);
|
info = rep_hist_format_router_status(hist, now);
|
||||||
if (info)
|
if (info)
|
||||||
smartlist_add(chunks, info);
|
smartlist_add(chunks, info);
|
||||||
|
|
||||||
} DIGESTMAP_FOREACH_END;
|
} DIGESTMAP_FOREACH_END;
|
||||||
|
|
||||||
result = smartlist_join_strings(chunks, "", 0, NULL);
|
result = smartlist_join_strings(chunks, "", 0, NULL);
|
||||||
|
|
Loading…
Add table
Reference in a new issue