Files
lighthouse/beacon_node/client/src/metrics.rs
chonghe d54dc685a3 Add optimistic_sync metric (#8059)
* #7974


  Display `0` if optimistic sync and `1` for normal sync


Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>
2025-11-12 05:26:20 +00:00

31 lines
960 B
Rust

pub use 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 IS_OPTIMISTIC_SYNC: LazyLock<Result<IntGauge>> = LazyLock::new(|| {
try_create_int_gauge(
"optimistic_sync",
"Metric to check if the beacon chain is in optimistic sync mode. 0 if synced and 1 if optimistic sync",
)
});
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",
)
});