chore: move metrics to submodule (#2265)

This commit is contained in:
Matthias Seitz
2023-04-15 11:37:41 +02:00
committed by GitHub
parent 31caaf8ee8
commit ec097fabf1
2 changed files with 16 additions and 14 deletions

View File

@@ -0,0 +1,14 @@
use metrics::Counter;
use reth_metrics_derive::Metrics;
/// Beacon consensus engine metrics.
#[derive(Metrics)]
#[metrics(scope = "consensus.engine.beacon")]
pub(crate) struct Metrics {
/// 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,
}

View File

@@ -1,5 +1,5 @@
use crate::engine::metrics::Metrics;
use futures::{Future, FutureExt, StreamExt};
use metrics::Counter;
use reth_db::{database::Database, tables, transaction::DbTx};
use reth_interfaces::{
blockchain_tree::{BlockStatus, BlockchainTreeEngine},
@@ -8,7 +8,6 @@ use reth_interfaces::{
sync::SyncStateUpdater,
Error,
};
use reth_metrics_derive::Metrics;
use reth_payload_builder::{PayloadBuilderAttributes, PayloadBuilderHandle};
use reth_primitives::{BlockNumber, Header, SealedBlock, H256};
use reth_rpc_types::engine::{
@@ -32,21 +31,10 @@ pub use error::{BeaconEngineError, BeaconEngineResult};
mod message;
pub use message::BeaconEngineMessage;
mod metrics;
mod pipeline_state;
pub use pipeline_state::PipelineState;
/// Beacon consensus engine metrics.
#[derive(Metrics)]
#[metrics(scope = "consensus.engine.beacon")]
struct Metrics {
/// The number of times the pipeline was run.
pipeline_runs: Counter,
/// The total count of forkchoice updated messages received.
forkchoice_updated_messages: Counter,
/// The total count of new payload messages received.
new_payload_messages: Counter,
}
/// The beacon consensus engine is the driver that switches between historical and live sync.
///
/// The beacon consensus engine is itself driven by messages from the Consensus Layer, which are