Add an authority_discovery_known_authorities_count metric (#6614)

This commit is contained in:
Pierre Krieger
2020-07-09 14:32:55 +02:00
committed by GitHub
parent 389faaf5c8
commit ef8572f10d
2 changed files with 18 additions and 0 deletions
@@ -68,6 +68,11 @@ where
self.cache.insert(id, addresses);
}
/// Returns the number of authority IDs in the cache.
pub fn num_ids(&self) -> usize {
self.cache.len()
}
// Each node should connect to a subset of all authorities. In order to prevent hot spots, this
// selection is based on randomness. Selecting randomly each time we alter the address cache
// would result in connection churn. To reduce this churn a node generates a seed on startup and