// Uses the provided summary to update the DKG metrics. Should only be used on
// the summary for the last finalized DKG summary block.
Uses the provided summary to update the DKG metrics. Should only be used on
the summary for the last finalized DKG summary block.
Uses the provided summary to update the DKG metrics . Should only be used on the summary for the last finalized DKG summary block .
fn update_dkg_metrics(&self, summary: &Summary) {
        self.metrics
            .consensus_membership_registry_version
            .set(summary.registry_version.get() as i64);
        for tag in [NiDkgTag::LowThreshold, NiDkgTag::HighThreshold].iter() {
            let current_transcript = summary.current_transcript(tag);
            let metric_label = &format!("{:?}", tag);
            self.metrics
                .dkg_instance_id
                .with_label_values(&[metric_label])
                .set(current_transcript.dkg_id.start_block_height.get() as i64);
            self.metrics
                .current_committee_size
                .with_label_values(&[metric_label])
                .set(current_transcript.committee.count().get().into());
            if summary.next_transcript(tag).is_none() && summary.height > Height::from(0) {
                warn!(
                    self.logger,
                    "No new {:?} DKG transcript is available in summary at height {:?}.",
                    tag,
                    summary.height
                );
                self.metrics
                    .failed_dkg_intervals
                    .with_label_values(&[metric_label])
                    .inc();
            }
        }
    }
fn update_dkg_metrics ( & self , summary : & Summary ) { self . metrics . consensus_membership_registry_version . set ( summary . registry_version . get ( ) as i64 ) ; for tag in [ NiDkgTag :: LowThreshold , NiDkgTag :: HighThreshold ] . iter ( ) { let current_transcript = summary . current_transcript ( tag ) ; let metric_label = & format ! ( " " tag ) ; self . metrics . dkg_instance_id . with_label_values ( & [ metric_label ] ) . set ( current_transcript . dkg_id . start_block_height . get ( ) as i64 ) ; self . metrics . current_committee_size . with_label_values ( & [ metric_label ] ) . set ( current_transcript . committee . count ( ) . get ( ) . into ( ) ) ; if summary . next_transcript ( tag ) . is_none ( ) && summary . height > Height :: from ( 0 ) { warn ! ( self logger " " tag summary height ) ; self . metrics . failed_dkg_intervals . with_label_values ( & [ metric_label ] ) . inc ( ) ; } } }
Uses the provided summary to update the DKG metrics.
Uses the provided summary to update the DKG metrics .
&self
summary
&Summary