Skip to content
Snippets Groups Projects
Commit 798de833 authored by Max Inden's avatar Max Inden Committed by GitHub
Browse files

client/authority-discovery: Add metric exposing priority group size (#5707)

Expose the amount of addresses that are passed from the authority
discovery module down to the network peer set manager as a priority
group in order to connect to the corresponding nodes.

```
authority_discovery_priority_group_size 10
```
parent 723ee05a
No related merge requests found
...@@ -475,6 +475,10 @@ where ...@@ -475,6 +475,10 @@ where
fn update_peer_set_priority_group(&self) -> Result<()> { fn update_peer_set_priority_group(&self) -> Result<()> {
let addresses = self.addr_cache.get_subset(); let addresses = self.addr_cache.get_subset();
if let Some(metrics) = &self.metrics {
metrics.priority_group_size.set(addresses.len().try_into().unwrap_or(std::u64::MAX));
}
debug!( debug!(
target: LOG_TARGET, target: LOG_TARGET,
"Applying priority group {:?} to peerset.", addresses, "Applying priority group {:?} to peerset.", addresses,
...@@ -599,6 +603,7 @@ pub(crate) struct Metrics { ...@@ -599,6 +603,7 @@ pub(crate) struct Metrics {
amount_last_published: Gauge<U64>, amount_last_published: Gauge<U64>,
request: Counter<U64>, request: Counter<U64>,
dht_event_received: CounterVec<U64>, dht_event_received: CounterVec<U64>,
priority_group_size: Gauge<U64>,
} }
impl Metrics { impl Metrics {
...@@ -637,6 +642,13 @@ impl Metrics { ...@@ -637,6 +642,13 @@ impl Metrics {
)?, )?,
registry, registry,
)?, )?,
priority_group_size: register(
Gauge::new(
"authority_discovery_priority_group_size",
"Number of addresses passed to the peer set as a priority group."
)?,
registry,
)?,
}) })
} }
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment