aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist/fmt_routerstatus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/feature/nodelist/fmt_routerstatus.c')
-rw-r--r--src/feature/nodelist/fmt_routerstatus.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/feature/nodelist/fmt_routerstatus.c b/src/feature/nodelist/fmt_routerstatus.c
index 252b2e61fe..6db40c0b68 100644
--- a/src/feature/nodelist/fmt_routerstatus.c
+++ b/src/feature/nodelist/fmt_routerstatus.c
@@ -1,6 +1,6 @@
/* Copyright (c) 2001-2004, Roger Dingledine.
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2020, The Tor Project, Inc. */
+ * Copyright (c) 2007-2021, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
@@ -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"
@@ -87,7 +87,7 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version,
goto done;
smartlist_add_asprintf(chunks,
- "s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "s%s%s%s%s%s%s%s%s%s%s%s%s\n",
/* These must stay in alphabetical order. */
rs->is_authority?" Authority":"",
rs->is_bad_exit?" BadExit":"",
@@ -98,6 +98,7 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version,
rs->is_flagged_running?" Running":"",
rs->is_stable?" Stable":"",
rs->is_staledesc?" StaleDesc":"",
+ rs->is_sybil?" Sybil":"",
rs->is_v2_dir?" V2Dir":"",
rs->is_valid?" Valid":"");
@@ -194,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));
}
}