From c0a4c4a6ef31e9e5e287e2ae1a70bde04b2e7039 Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 23 Nov 2023 07:41:33 +1000 Subject: [PATCH] Remove the never_attempted_alternate AddressBookMetrics --- zebra-network/src/address_book.rs | 15 +-------------- zebra-network/src/address_book_updater.rs | 7 +++---- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/zebra-network/src/address_book.rs b/zebra-network/src/address_book.rs index 237e33bf1f6..50d18be2ada 100644 --- a/zebra-network/src/address_book.rs +++ b/zebra-network/src/address_book.rs @@ -112,9 +112,6 @@ pub struct AddressMetrics { /// The number of addresses in the `NeverAttemptedGossiped` state. pub never_attempted_gossiped: usize, - /// The number of addresses in the `NeverAttemptedAlternate` state. - pub never_attempted_alternate: usize, - /// The number of addresses in the `Failed` state. pub failed: usize, @@ -680,7 +677,6 @@ impl AddressBook { AddressMetrics { responded, never_attempted_gossiped, - never_attempted_alternate, failed, attempt_pending, recently_live, @@ -702,10 +698,6 @@ impl AddressBook { // TODO: rename to address_book.[state_name] metrics::gauge!("candidate_set.responded", m.responded as f64); metrics::gauge!("candidate_set.gossiped", m.never_attempted_gossiped as f64); - metrics::gauge!( - "candidate_set.alternate", - m.never_attempted_alternate as f64, - ); metrics::gauge!("candidate_set.failed", m.failed as f64); metrics::gauge!("candidate_set.pending", m.attempt_pending as f64); @@ -751,12 +743,7 @@ impl AddressBook { self.last_address_log = Some(now); // if all peers have failed - if m.responded - + m.attempt_pending - + m.never_attempted_gossiped - + m.never_attempted_alternate - == 0 - { + if m.responded + m.attempt_pending + m.never_attempted_gossiped == 0 { warn!( address_metrics = ?m, "all peer addresses have failed. Hint: check your network connection" diff --git a/zebra-network/src/address_book_updater.rs b/zebra-network/src/address_book_updater.rs index f0729b3efb0..2feeb49e8e0 100644 --- a/zebra-network/src/address_book_updater.rs +++ b/zebra-network/src/address_book_updater.rs @@ -106,10 +106,9 @@ impl AddressBookUpdater { .set_pos(u64::try_from(address_info.num_addresses).expect("fits in u64")); // .set_len(u64::try_from(address_info.address_limit).expect("fits in u64")); - let never_attempted = address_info.never_attempted_alternate - + address_info.never_attempted_gossiped; - - never_bar.set_pos(u64::try_from(never_attempted).expect("fits in u64")); + never_bar.set_pos( + u64::try_from(address_info.never_attempted_gossiped).expect("fits in u64"), + ); // .set_len(u64::try_from(address_info.address_limit).expect("fits in u64")); failed_bar.set_pos(u64::try_from(address_info.failed).expect("fits in u64"));