fn update_metrics(&mut self, instant_now: Instant, chrono_now: chrono::DateTime<Utc>) {
        let _guard = self.span.enter();

        let m = self.address_metrics_internal(chrono_now);

        // Ignore errors: we don't care if any receivers are listening.
        let _ = self.address_metrics_tx.send(m);

        // 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);

        // TODO: rename to address_book.responded.recently_live
        metrics::gauge!("candidate_set.recently_live", m.recently_live as f64);
        // TODO: rename to address_book.responded.stopped_responding
        metrics::gauge!(
            "candidate_set.disconnected",
            m.recently_stopped_responding as f64
        );

        std::mem::drop(_guard);
        self.log_metrics(&m, instant_now);
    }
/// Update the metrics for this address book.
Update the metrics for this address book.
Update the metrics for this address book .
fn update_metrics(&mut self, instant_now: Instant, chrono_now: chrono::DateTime<Utc>) {
        let _guard = self.span.enter();
        let m = self.address_metrics_internal(chrono_now);
        // Ignore errors: we don't care if any receivers are listening.
        let _ = self.address_metrics_tx.send(m);
        // 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);
        // TODO: rename to address_book.responded.recently_live
        metrics::gauge!("candidate_set.recently_live", m.recently_live as f64);
        // TODO: rename to address_book.responded.stopped_responding
        metrics::gauge!(
            "candidate_set.disconnected",
            m.recently_stopped_responding as f64
        );
        std::mem::drop(_guard);
        self.log_metrics(&m, instant_now);
    }
fn update_metrics ( & mut self , instant_now : Instant , chrono_now : chrono :: DateTime < Utc > ) { let _guard = self . span . enter ( ) ; let m = self . address_metrics_internal ( chrono_now ) ; // Ignore errors: we don't care if any receivers are listening. let _ = self . address_metrics_tx . send ( m ) ; // TODO: rename to address_book.[state_name] metrics :: gauge ! ( " " m responded as f64 ) ; metrics :: gauge ! ( " " m never_attempted_gossiped as f64 ) ; metrics :: gauge ! ( " " m never_attempted_alternate as f64 ) ; metrics :: gauge ! ( " " m failed as f64 ) ; metrics :: gauge ! ( " " m attempt_pending as f64 ) ; // TODO: rename to address_book.responded.recently_live metrics :: gauge ! ( " " m recently_live as f64 ) ; // TODO: rename to address_book.responded.stopped_responding metrics :: gauge ! ( " " m recently_stopped_responding as f64 ) ; std :: mem :: drop ( _guard ) ; self . log_metrics ( & m , instant_now ) ; }
Update the metrics for this address book.
Update the metrics for this address book .
&mut self
instant_now
Instant
chrono_now
chrono::DateTime<Utc>