pub fn scrape_for_metrics<T: BeaconChainTypes>(beacon_chain: &BeaconChain<T>) {
    if let Ok(head) = beacon_chain.head() {
        scrape_head_state::<T>(&head.beacon_state, head.beacon_state_root())
    }

    if let Some(slot) = beacon_chain.slot_clock.now() {
        scrape_attestation_observation(slot, beacon_chain);
    }

    set_gauge_by_usize(
        &OP_POOL_NUM_ATTESTATIONS,
        beacon_chain.op_pool.num_attestations(),
    );
    set_gauge_by_usize(
        &OP_POOL_NUM_ATTESTER_SLASHINGS,
        beacon_chain.op_pool.num_attester_slashings(),
    );
    set_gauge_by_usize(
        &OP_POOL_NUM_PROPOSER_SLASHINGS,
        beacon_chain.op_pool.num_proposer_slashings(),
    );
    set_gauge_by_usize(
        &OP_POOL_NUM_VOLUNTARY_EXITS,
        beacon_chain.op_pool.num_voluntary_exits(),
    );

    beacon_chain
        .validator_monitor
        .read()
        .scrape_metrics(&beacon_chain.slot_clock, &beacon_chain.spec);
}
/// Scrape the `beacon_chain` for metrics that are not constantly updated (e.g., the present slot,
/// head state info, etc) and update the Prometheus `DEFAULT_REGISTRY`.
Scrape the `beacon_chain` for metrics that are not constantly updated  and update the Prometheus `DEFAULT_REGISTRY`.
Scrape the ` beacon_chain ` for metrics that are not constantly updated and update the Prometheus ` DEFAULT_REGISTRY ` .
pub fn scrape_for_metrics<T: BeaconChainTypes>(beacon_chain: &BeaconChain<T>) {
    if let Ok(head) = beacon_chain.head() {
        scrape_head_state::<T>(&head.beacon_state, head.beacon_state_root())
    }
    if let Some(slot) = beacon_chain.slot_clock.now() {
        scrape_attestation_observation(slot, beacon_chain);
    }
    set_gauge_by_usize(
        &OP_POOL_NUM_ATTESTATIONS,
        beacon_chain.op_pool.num_attestations(),
    );
    set_gauge_by_usize(
        &OP_POOL_NUM_ATTESTER_SLASHINGS,
        beacon_chain.op_pool.num_attester_slashings(),
    );
    set_gauge_by_usize(
        &OP_POOL_NUM_PROPOSER_SLASHINGS,
        beacon_chain.op_pool.num_proposer_slashings(),
    );
    set_gauge_by_usize(
        &OP_POOL_NUM_VOLUNTARY_EXITS,
        beacon_chain.op_pool.num_voluntary_exits(),
    );
    beacon_chain
        .validator_monitor
        .read()
        .scrape_metrics(&beacon_chain.slot_clock, &beacon_chain.spec);
}
pub fn scrape_for_metrics < T : BeaconChainTypes > ( beacon_chain : & BeaconChain < T > ) { if let Ok ( head ) = beacon_chain . head ( ) { scrape_head_state :: < T > ( & head . beacon_state , head . beacon_state_root ( ) ) } if let Some ( slot ) = beacon_chain . slot_clock . now ( ) { scrape_attestation_observation ( slot , beacon_chain ) ; } set_gauge_by_usize ( & OP_POOL_NUM_ATTESTATIONS , beacon_chain . op_pool . num_attestations ( ) , ) ; set_gauge_by_usize ( & OP_POOL_NUM_ATTESTER_SLASHINGS , beacon_chain . op_pool . num_attester_slashings ( ) , ) ; set_gauge_by_usize ( & OP_POOL_NUM_PROPOSER_SLASHINGS , beacon_chain . op_pool . num_proposer_slashings ( ) , ) ; set_gauge_by_usize ( & OP_POOL_NUM_VOLUNTARY_EXITS , beacon_chain . op_pool . num_voluntary_exits ( ) , ) ; beacon_chain . validator_monitor . read ( ) . scrape_metrics ( & beacon_chain . slot_clock , & beacon_chain . spec ) ; }
Scrape the `beacon_chain` for metrics that are not constantly updated (e.g., the present slot,
head state info, etc) and update the Prometheus `DEFAULT_REGISTRY`.
Scrape the ` beacon_chain ` for metrics that are not constantly updated ( e . g . the present slot head state info etc ) and update the Prometheus ` DEFAULT_REGISTRY ` .
beacon_chain
&BeaconChain<T>