Files
lighthouse/beacon_node/client/src/metrics.rs
Jimmy Chen 96b00ef66c Replace lazy_static! with LazyLock (#6189)
* Replace `lazy_static` with `LazyLock`.

* Merge branch 'unstable' into remove-lazy-static

# Conflicts:
#	beacon_node/lighthouse_network/src/peer_manager/mod.rs

* Lint fixes.

* Merge branch 'unstable' into remove-lazy-static

# Conflicts:
#	beacon_node/beacon_chain/src/metrics.rs

* Moar lint fixes.

* Update rust version to 1.80.0.

* Merge branch 'unstable' into remove-lazy-static
2024-07-29 11:42:31 +00:00

24 lines
715 B
Rust

pub use lighthouse_metrics::*;
use std::sync::LazyLock;
pub static SYNC_SLOTS_PER_SECOND: LazyLock<Result<IntGauge>> = LazyLock::new(|| {
try_create_int_gauge(
"sync_slots_per_second",
"The number of blocks being imported per second",
)
});
pub static IS_SYNCED: LazyLock<Result<IntGauge>> = LazyLock::new(|| {
try_create_int_gauge(
"sync_eth2_synced",
"Metric to check if the beacon chain is synced to head. 0 if not synced and non-zero if synced"
)
});
pub static NOTIFIER_HEAD_SLOT: LazyLock<Result<IntGauge>> = LazyLock::new(|| {
try_create_int_gauge(
"notifier_head_slot",
"The head slot sourced from the beacon chain notifier",
)
});