1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use reth_metrics::{
    metrics::{Counter, Gauge, Histogram},
    Metrics,
};

/// Beacon consensus engine metrics.
#[derive(Metrics)]
#[metrics(scope = "consensus.engine.beacon")]
pub(crate) struct EngineMetrics {
    /// The number of times the pipeline was run.
    pub(crate) pipeline_runs: Counter,
    /// The total count of forkchoice updated messages received.
    pub(crate) forkchoice_updated_messages: Counter,
    /// The total count of new payload messages received.
    pub(crate) new_payload_messages: Counter,
    /// Latency for making canonical already canonical block
    pub(crate) make_canonical_already_canonical_latency: Histogram,
    /// Latency for making canonical committed block
    pub(crate) make_canonical_committed_latency: Histogram,
    /// Latency for making canonical returns error
    pub(crate) make_canonical_error_latency: Histogram,
    /// Latency for all making canonical results
    pub(crate) make_canonical_latency: Histogram,
}

/// Metrics for the `EngineSyncController`.
#[derive(Metrics)]
#[metrics(scope = "consensus.engine.beacon")]
pub(crate) struct EngineSyncMetrics {
    /// How many blocks are currently being downloaded.
    pub(crate) active_block_downloads: Gauge,
}