summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-03-10 16:47:46 -0500
committerNick Mathewson <nickm@torproject.org>2021-03-10 16:47:46 -0500
commit7d9403b42218596108dfa0e614b79f4217912a90 (patch)
tree1412c9ab1b7c68dc23de7f92caf40f030e713fc8 /src
parentf98dbdb0693afa7dcbf1f395fa7e97116b59199e (diff)
parent9f9fed3fd167d564ec669ee46d2da923fb887803 (diff)
downloadtor-7d9403b42218596108dfa0e614b79f4217912a90.tar.gz
tor-7d9403b42218596108dfa0e614b79f4217912a90.zip
Merge remote-tracking branch 'tor-gitlab/mr/336'
Diffstat (limited to 'src')
-rw-r--r--src/feature/nodelist/fmt_routerstatus.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/feature/nodelist/fmt_routerstatus.c b/src/feature/nodelist/fmt_routerstatus.c
index 5c1e9309b9..51f7ee7d95 100644
--- a/src/feature/nodelist/fmt_routerstatus.c
+++ b/src/feature/nodelist/fmt_routerstatus.c
@@ -15,11 +15,11 @@
#include "feature/nodelist/fmt_routerstatus.h"
#include "core/or/policies.h"
-#include "feature/nodelist/routerlist.h"
#include "feature/dirauth/dirvote.h"
-
#include "feature/nodelist/routerinfo_st.h"
+#include "feature/nodelist/routerlist.h"
#include "feature/nodelist/vote_routerstatus_st.h"
+#include "feature/stats/rephist.h"
#include "lib/crypt_ops/crypto_format.h"
@@ -195,6 +195,15 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version,
digest256_to_base64(ed_b64, (const char*)vrs->ed25519_id);
smartlist_add_asprintf(chunks, "id ed25519 %s\n", ed_b64);
}
+
+ /* We'll add a series of statistics to the vote per relays so we are
+ * able to assess what each authorities sees and help our health and
+ * performance work. */
+ time_t now = time(NULL);
+ smartlist_add_asprintf(chunks, "stats wfu=%.6f tk=%lu mtbf=%.0f\n",
+ rep_hist_get_weighted_fractional_uptime(rs->identity_digest, now),
+ rep_hist_get_weighted_time_known(rs->identity_digest, now),
+ rep_hist_get_stability(rs->identity_digest, now));
}
}